What version of PHP do you use?
We currently offer several different versions of PHP:
- PHP 8.2.12 (view phpinfo)
- PHP 8.1.25 (view phpinfo)
- PHP 8.0.30 (view phpinfo)
- PHP 7.4.33 (view phpinfo)
- PHP 7.3.33 (view phpinfo)
- PHP 7.2.34 (view phpinfo)
- PHP 7.1.33 (view phpinfo)
Our default PHP version for new accounts is PHP 8.2.12.
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
- How long are older PHP versions available for?
- 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.
How long are older PHP versions available for?
We support PHP versions for two years after the PHP authors completely stop supporting them, which is generally four years after they release the next version of PHP. The PHP authors have a page explaining their supported dates for different PHP versions (we support them until two years after the “Security Support Until” date shown there).
This gives our customers four years to make sure their scripts are compatible with any PHP updates. While some older versions of PHP may still work on our servers after that, we don’t provide official support for them, and sites using them may be upgraded to a newer version of PHP at any time (we’ll give you 90 days notice if this happens).
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 (although the separate versions won’t use FastCGI and will be slower than PHP normally runs).
To do this, you’ll need to add a .htaccess file inside the directory that contains scripts that require a different version (or add lines to an existing .htaccess file there).
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 it starts a separate copy of PHP instead of using the “global” version for your site that is already started by FastCGI.
You can currently choose from PHP versions 8.1.25, 8.0.30, 7.4.33, 7.3.33, 7.2.34, or 7.1.33 by using one of these sets of lines:
SetEnv USE_PHP_BINARY /usr/bin/php-cgi-8.2 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-8.1 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-8.0 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-7.4 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-7.3 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-7.2 AddHandler application/x-httpd-php .php SetEnv USE_PHP_BINARY /usr/bin/php-cgi-7.1 AddHandler application/x-httpd-php .php
Don’t forget to undo this when you no longer need it.
Setting a directory to work this way makes PHP scripts in that directory run more slowly than normal because they can’t use FastCGI. In addition, older PHP versions eventually get completely removed, and your site would stop working if you were still using these lines when that happened.
Because of that, this should only be done for short-term temporary or testing purposes, and you should remove these lines as soon as you can switch your entire site to use a single newer version of PHP.
Note that if you have enabled Zend Guard or ionCube Loader 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-8.2 /usr/bin/php-8.1 /usr/bin/php-8.0 /usr/bin/php-7.4 /usr/bin/php-7.3 /usr/bin/php-7.2 /usr/bin/php-7.1
Copyright © 2000-2023 Tiger Technologies LLC