Our System Administrators team has developed and is actively implementing a software solution that will allow our Shared and Reseller customers to select one of multiple PHP versions for a cPanel account to use. If this functionality is not presently available to you, rest assured that our team is working to bring it to your server quickly.
Intent
The goal of offering multiple PHP versions is not to provide support for end of life PHP versions, which at this time include PHP 5.4 and below. Instead, we understand it can take time for our customers to coordinate with their developers and/or software vendors to upgrade their software to support newer PHP versions. By making these versions available for use, our customers can make plans to transition to a stable, supported PHP version and have the option to switch back and forth between the old and new version during that process to ensure the software works on the new version.
Support for Older PHP Versions
At this time, we are providing as-is support for PHP 5.3 and 5.4, which are both end of life. Customers that continue to use these versions will be subject to header 1.1.9 of our Terms of Service regarding end of life software. We therefore recommend developing and executing a plan to move your cPanel account(s) to use PHP 5.5 as soon as possible to continue to receive the full benefits of our managed support.
PHP 5.5 Lifetime
Please take note that PHP 5.5 is already at the stage of its life where it is receiving only security updates. This support will end and PHP 5.5 will become end of life on July 10th, 2016. Due to technical limitations, we are unable to offer PHP 5.6 support on some of our servers running older operating systems. We will ensure that servers running newer operating systems gain PHP 5.6 support before PHP 5.5 becomes end of life, but for customers on servers where this support cannot be added, PHP 5.5 will remain the highest available version and as such will be, on those servers only, exempted from our end of life software policy in our Terms of Service.
We have plans to migrate all clients on servers with older operating systems to servers with newer operating systems, but these plans will not complete before PHP 5.5 becomes end of life. If by July 10th, 2016 you are on a server that cannot offer PHP 5.6 support and require PHP 5.6 support for your software to work, please contact our support team to inquire about transferring to a server where PHP 5.6 is supported.
Changing Your Account’s PHP Version
Please feel free to contact our support team for assistance if you do not feel comfortable doing this yourself.
If you would like to adjust this yourself, you will want to use cPanel File Manager, FTP, or SSH (if your account does not have SSH access, our support team can enabled this for you) to edit /home/USER/.htaccess, where USER is the username of the cPanel account whose PHP version you want to change. If you cannot find this file, please make sure you enable viewing of hidden files, and if you still cannot find it then you will need to create it.
PHP 5.3
To enable PHP 5.3, please make sure /home/USER/.htaccess contains the following:
AddType application/x-httpd-php53 .php5 .php4 .php .php3 .php2 .phtml
suPHP_ConfigPath /usr/local/lib/php53.ini
PHP 5.4
To enable PHP 5.4, please make sure /home/USER/.htaccess contains the following:
AddType application/x-httpd-php54 .php5 .php4 .php .php3 .php2 .phtml
suPHP_ConfigPath /usr/local/lib/php54.ini
PHP 5.5
At this time, PHP 5.5 is the default PHP version on our servers. This means you will want to ensure that all AddType and suPHP_ConfigPath directives in /home/USER/.htaccess are commented-out so your desired cPanel account uses the default handler and configuration, which will be for PHP 5.5. For example:
# AddType application/x-httpd-php54 .php5 .php4 .php .php3 .php2 .phtml
# suPHP_ConfigPath /usr/local/lib/php54.ini
The above will enable PHP 5.5.
PHP 5.6
To enable PHP 5.6, please make sure /home/USER/.htaccess contains the following:
AddType application/x-httpd-php56 .php5 .php4 .php .php3 .php2 .phtml
suPHP_ConfigPath /usr/local/lib/php56.ini
Multi-PHP and Crons
For any crons you have created which use php directly, you will want to check your Crontab (in SSH, crontab -e). If it looks something like the below:
0 * * * * php /home/USER/public_html/beta/cron.php
Your cron will use the server’s default PHP version, which at this time will be PHP 5.5.
Use PHP 5.3 for Crons
To use PHP 5.3 for a cron using PHP, replace php with php53 -c /usr/local/lib/php53.ini. For example:
0 * * * * php53 -c /usr/local/lib/php53.ini /home/USER/public_html/beta/cron.php
Use PHP 5.4 for Crons
To use PHP 5.4 for a cron using PHP, replace php with php54 -c /usr/local/lib/php54.ini. For example:
0 * * * * php54 -c /usr/local/lib/php54.ini /home/USER/public_html/beta/cron.php
Use PHP 5.6 for Crons
To use PHP 5.6 for a cron using PHP, replace php with php56 -c /usr/local/lib/php56.ini. For example:
0 * * * * php56 -c /usr/local/lib/php56.ini /home/USER/public_html/beta/cron.php
Further Considerations
We only support adjusting /home/USER/.htaccess to change the PHP version for an entire account. Despite this, it is technically possible to have .htaccess files in subdirectories overwrite this user-wide configuration. We will not support this as a valid method for changing part of an account’s PHP version, but we want to make customers aware of this because it means that any AddType or suPHP_ConfigPath directives in such .htaccess files can prevent the configuration at /home/USER/.htaccess from working as intended.
For example, there may be a setting in /home/USER/public_html/.htaccess like:
suPHP_ConfigPath /home/USER/public_html
This would use /home/USER/public_html/php.ini instead of /usr/local/lib/php.ini or whichever configuration was set in /home/USER/.htaccess. This can cause problems if for example /home/USER/public_html/php.ini was created for PHP 5.3 but the account is running PHP 5.5. If you run into any issues with changing your account’s PHP version, please let our team know so we can assist you, and please also let our team know if you have requested or implemented PHP customizations for the account in the past, as this may assist our team in expediting resolution of your issue.