How to install PHP 7.0, 7.1, 7.2 or any other PHP version on your server

NodeChef PHP hosting allows you to run PHP 5.6.x, 7.0.x, 7.1.x and 7.2.x versions of PHP as of this writing. We automatically install the version of PHP for you once you specify it.

Prerequisites

Before migrating your app to a newer version of PHP, it is important to read the possible migration incompatibilities. We have provided links below:

Step 1. Create the .bp-config/options.json file

In the root folder of your application create a folder with name .bp-config. Under this folder create a file with name options.json

The below example shows an example PHP app directory after you create the .bp-config/options.json file.

index.php composer.json .bp-config/ options.json

Step 2. Specify the PHP version

Use the example JSON format below to specify the version. Note, You do not have to specify the exact version just use the format as show below.

{ "PHP_VERSION" : "{PHP_71_LATEST}" }

The supported values for the PHP_VERSION option includes:

Note: If you happen to be using a composer.json file and you set the version of PHP in that file, the version specified in the composer.json file has a higher precedence over the version set using the options.json file.

Step 3. Deploy your applicaiton

Zip your PHP project folder and upload it from the dashboard and your PHP app should run with the version you specified. You can also use the CLI to deploy your PHP app.