What version of PHP do you use?
We currently offer several different versions of PHP:
Our default PHP version for new accounts is PHP 7.0.27.
Click “view phpinfo” to see the default settings for each. Remember that you can override most of these settings; the sample page is useful for showing what modules we have installed and what defaults we use.
On this page:
- Choosing the PHP version for your website
- Using different PHP versions for different directories
- Using different versions of PHP on the command line or cron jobs
Choosing the PHP version for your website
You can use our "My Account" control panel to choose which version your site uses for web scripts:
- Login to the “My Account” control panel (having trouble?)
- Click PHP Settings
- Click the version you want to use
- Click Save Settings
If you’re not sure which version to choose, our Why Update PHP? page has more information.
Using different PHP versions for different directories
If different parts of your site require different PHP versions, it’s possible for technically advanced users to do that. You’ll need to add a .htaccess file to the directory containing scripts that require a different version.
The file should set an environment variable named USE_PHP_BINARY containing the path to the PHP version that you want to use, together with an AddHandler line to ensure that FastCGI isn’t used.
You can currently choose from PHP versions 7.1.13, 7.0.27, or 5.6.33 by using one of these sets of lines:
SetEnv USE_PHP_BINARY /usr/bin/php-cgi-7.1 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-7.0 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-5.6 AddHandler application/x-httpd-php .php
Note that if you have enabled Zend Guard, ionCube Loader or eAccelerator in our control panel, and you're forcing a certain directory to use a version of PHP that doesn’t support those extensions, it will generate warnings in your error logs that the version of the extension doesn’t match the PHP version. There’s no way around the warnings, unfortunately, although it won’t cause any actual problems.
Using different versions of PHP on the command line or cron jobs
You can choose a different version of PHP to use in the shell by explicitly specifying one of these paths:
/usr/bin/php-7.1 /usr/bin/php-7.0 /usr/bin/php-5.6