Back to PHP (Applications and Scripts)

How To Fix PHP Incompatibility Issues From The PHP 7 Upgrade


Starting June 2017, Midphase 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 back 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
</IfModule>


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 you have this directive in your .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

How To Correct PHP Issues Related To The PHP 7.4 Upgrade
PHP 7.4 and MariaDB 10.3 Upgrade Schedule
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

Can’t Find what you need?

No worries, Our experts are here to help.