Back to PHP Upgrade

How To Correct PHP Issues Related To The PHP 7.0 Upgrade

Starting April 24, 2017, WestHost will be upgrading our servers to PHP 7.0. This may cause some compatibility issues with your site. Fortunately, our servers will allow one month to revert to PHP 5.6 and correct any of these issues before PHP 5.6 is permanently removed. Essentially, this will allow clients with outdated PHP code to run the older PHP version while updating their site.

Reverting to PHP 5.6 is pretty simple. It can be done by adding one line to your .htaccess file:

To determine which PHP version to use, the PHP executable checks the AddType directive in the local .htaccess file. Thus, all you need to do to revert to PHP 5.6 is access your .htaccess file through FileManager and add the following line.

<IfModule mime_module>
AddType application/x-httpd-ea-php56 .php .php7 .phtml

In this line, the system will use PHP 5.6. If an .htaccess file does not exist in the current directory, or one exists but does not contain the AddType directive; the system ascends the directory tree until it finds an .htaccess file that contains the directive. If the system cannot find an .htaccess file, it uses the default version of PHP (7.0).

Please note that if the client has this directive in their .htaccess you will want to comment the old line out before inserting this line or change the trailing version number. Leave out the "." in the php version number.

Related Articles

PHP 7.3 and HTTP/2 Upgrade Schedule
How To Correct PHP Issues Related To The PHP 7.3 Upgrade
PHP 7.2 Release Notes
PHP 7.2 Upgrade Schedule
How to Correct Issues Related to PHP 7.2 Update

Can’t Find what you need?

No worries, Our experts are here to help.