PHP (= Hypertext Preprocessor) is an HTML-embedded server-side scripting language.

PHP is distributed at no charge for commercial or non-commercial use. For more information read the LICENSE information.

More information about PHP can be found at:

PHP manuals can be found at:

The latest PHP version can be downloaded from:

Upgrade PHP on macOS using binaries from

This tutorial describes what to do if you have installed a PHP version using command:
curl -s | bash -s X.X
and you want to install a different PHP version on the macOS.

If you have never used before, see tutorial:
Installing PHP5.6.30 on macOS Sierra

Operating system used
macOS Sierra

Software prerequisites

  1. If you have installed a PHP version using, it will be installed in path:

    For example you have previously installed PHP 5.6.30:
    and a symbolic link php5 -> /usr/local/php5-5.6.30-20170506-093822 is created.

  2. On the website a new release is available, for example: PHP 5.6.31

  3. To install the new version type:
    curl -s | bash -s 5.6

    Note: It will always install the latest "patch" version, in this case: 5.6.31

  4. The new PHP version is installed in path:
    and a symbolic link php5 -> /usr/local/php5-5.6.31-20170817-164511 is created.

  5. If you have installed multiple PHP versions and want to switch versions, use the following command to change the symbolic link:

    sudo ln -sf /usr/local/php5-5.6.30-20170506-093822 php5