Updates from January, 2018 Toggle Comment Threads | Keyboard Shortcuts

  • ThomasPowell 5:30 pm on January 22, 2018 Permalink
    Tags: , high sierra, php 5.6, php 7   

    Apache Crashing with PHP 7 Enabled after High Sierra Upgrade 

    Upgrading (partially) for a System PHP 7

    I finally got around to upgrading to High Sierra, which has PHP 7 as a system PHP instead of PHP 5.6. As part of that upgrade, my quick hacks of httpd-vhosts.conf for a couple of small projects had disappeared, since bringing up those virtual hosts would bring up the default site.

    In the process of restoring these changes, I checked the main /private/etc/apache2/httpd.conf and noticed that
    LoadModule php7_module libexec/apache2/libphp7.so
    was commented out. So I uncommented it, much like I seem to recall doing for prior Apache setup.

    Problems and Debugging

    Strangely, after sudo /usr/sbin/apachectl restart, I was getting a connection refused. I checked for instances of httpd processes running:
    ps aux | grep httpd
    I found none.

    Eventually, I figured out that I could do a -k option on apachectl:


    sudo /usr/sbin/apachectl -k restart
    httpd not running, trying to start
    /usr/sbin/apachectl: line 92: 37326 Segmentation fault $HTTPD "[email protected]"

    Searching around on StackOverflow, I found that conflicting PHP versions were potentially the problem. So I commented out the php7 module again, restarted, and loaded a page with phpinfo(); on it. Sure enough, PHP 5.6 was running.

    Resolution

    Searching in /private/etc/apache2 for other php module mentions, I found /private/etc/apache2/other/+php-osx.conf and commented out the following line:


    LoadModule php5_module /usr/local/php5/libphp5.so

    Restoring the php7_module in httpd.conf, I restarted Apache, and magically phpinfo(); displayed the 7.1.7 PHP version.

     
  • tech0x20 3:32 pm on March 14, 2009 Permalink | Reply
    Tags: billing,   

    Mobile Billing Meter 

    Billing Meter bit.ly link or Billing Meter tech0x20 link.

    This isn’t perfect. First of all, some connections are just too slow for a constant refresh rate of less than 20-30 seconds. Secondly, I think many mobile browsers have a refresh cut-off at which point they will ask you if you really want to keep refreshing.

    The first page, index.php, allows you to enter parameters:

    Billing Meter












    Billing Rate per Hour
    Update Interval (in seconds)
    Press Submit to start the counter.


    The second file, meter.php, does the display, calculation and refresh:
    ";

    $netseconds = time()-$_SESSION["STARTTIME"];
    $cost = sprintf("%10.2lf", round($_SESSION["BILLINGRATE"]*((double)$netseconds)/3600.0,2));
    ?>

    Billing meter

    Time spent:

    ".$time_counter[$i]."

    ";
    }
    ?>

    Your bill:

    ".$cost[$i]."

    ";
    }
    }
    ?>

    $  

     
  • tech0x20 10:13 pm on March 13, 2009 Permalink | Reply
    Tags:   

    Two page mobile magic 8-ball 

    Two page mobile magic 8-ball

    Had to use random numbers to prevent caching of pages by mobile web browsers. It’s entirely possible that I made this workaround too complicated, as I had a file version problem on my local drive (I was updating the wrong file.)

    The first page uses a random number in a hidden field with the POST method:

    Magic 8-ball

    Ask your question, and click the button for an answer.
    ";
    ?>

    The second page appends a random number to the URL:


    Magic 8-Ball

    Magic 8-ball

    The magic 8-ball says:

    ";
    echo "Ask another question";

    ?>

     
    • Mike Campbell 7:21 am on March 14, 2009 Permalink | Reply

      Here’s a request. When I was in public accounting my clients would give me a hard time a joke about our fees. It was all in good fun. Now that I’m on the other side, I can really see where they are coming from. Every minute they are in our office working I can hear cha-ching and watch the dollars increasing. At one point I thought it would be humorous to put a taxi meter outside the conference room door where they were working. It would advance about 7 cents per second. Your magic eight ball gave me the idea to create a web page instead. Kind of like a countdown script, except it would count up and each second would be multiplied by a dollar amount based on an input variable. Then I could return the favor and poke some fun at my consultants.

      Mike Campbellā€™s last blog post..Make It Easy For Your Customers To Do Business With You

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
%d bloggers like this: