Category: PHP

  • Updating PHP to 7.2 on OSX using Homebrew

    Updating PHP to 7.2 on OSX using Homebrew

    PHP 7.2 provides several critical security updates and it’s important for any PHP developer to make sure that they leave the 5.x branch and jump on the 7.x branch as soon as possible.

    Updating to PHP 7.2 is a breeze If you’re on OSX and using Homebrew.

    Start by making sure that brew is up to date:

    brew update && brew upgrade

    Unlink any previous PHP installation (this may vary, so you might need to replace the php71 accordingly):

    brew unlink php71

    Install PHP 7.2:

    brew install php72

    Once done, you can verify that PHP 7.2 was installed by using php -v

    Happy coding!

  • Getting the PHP runtime for App Engine to run on Ubuntu

    AppEngine + PHPExciting news out of Google I/O 2013 reveals PHP support on Google AppEngine. As a php and a appengine-nerd, this is great news. And setting up the local development environment on Ubuntu (13.04) was a breeze.

    The PHP runtime for AppEngine requires the cgi-version of php 5.4 (and above) and python 2.7 (and above). Most Ubuntu-installations have python installed, but i’ll cover those steps as well, feel free to skip those if they are redundant for you.

    Installing Python

    sudo apt-get install python

    Installing php5-cgi
    (this should be safe to install even if you currently have a php-version installed since it’s the cgi version)

    sudo apt-get install php5-cgi

    Grabbing the AppEngine for PHP SDK

    wget http://commondatastorage.googleapis.com/appengine-php/appengine-php-sdk-1.8.0.zip
    unzip appengine-php-sdk-1.8.0.zip

    Starting a local AppEngine instance using php5-cgi

    ./dev_appserver.py /path/to/your/app –php_executable_path=/usr/bin/php5-cgi

    Your app should now be serving on http://localhost:8080/.

    More details can be found in the official documentation:
    https://developers.google.com/appengine/docs/php/gettingstarted/