PHP 7 is the next major update to the PHP programming language which offers several benefits over previous versions such as a new version of Zend Engine and faster performance.
PHP 7 has also removed several deprecated functions from previous versions. Because of this, users should not upgrade their sites until they are sure everything is fully compatible with the new version.
View the following article for instructions on how to update the PHP version of your site:
The following list is taken from php.net:
- Improved performance: PHP 7 is up to twice as fast as PHP 5.6
- Significantly reduced memory usage
- Abstract Syntax Tree
- Consistent 64-bit support
- Improved Exception hierarchy
- Many fatal errors converted to Exceptions
- Secure random number generator
- Removed old and unsupported SAPIs and extensions
- The null coalescing operator (??)
- Return and Scalar Type Declarations
- Anonymous Classes
- Zero cost asserts
General upgrading guidelines
- You can update the PHP version of your site in your panel.
- Make sure your software and any plugins/themes/extensions are compatible with PHP 7 before you upgrade.
- Make sure your database queries are using mysqli or PDO_MySQL to connect as the mysql extension has been removed. View the My site will not connect to my database after upgrading to PHP 7 section below for details.
PHP 7.3 Known issues
JIT compilation failed: no more memory errors
If you are seeing "JIT compilation failed: no more memory" errors on your site, this is due to a known bug in PHP 7.3. To work around this, you can disable the JIT compiler by adding the following line to your phprc file:
pcre.jit = 0
If you need assistance creating and/or modifying this file, then refer to the following instructions:
- How do I create a phprc file via FTP? (for beginners)
- How do I create a phprc file via SSH? (for advanced users)
What happened to PHP 6?
This was a development version that never became an official release. View the following links for further information:
Is PHP 7 available on Nginx machines?
My site will not connect to my database after upgrading to PHP 7
Previous versions of PHP offered three PHP APIs for accessing a MySQL database. They were:
PHP 7 has removed support for the mysql extension and affects the following:
- Any queries using a mysql_connect function will not function.
- PHP 7 only allows connections to a MySQL database using mysqli or PDO_MySQL.
All scripts must be updated in order to continue functioning.
The following PHP error may appear if your code uses sessions.
[Tue Jan 05 12:41:24.497212 2021] [fcgid:warn] [pid 16093:tid 4253425600256] [client xxx.xxx.xxx.xxx:11929] mod_fcgid: stderr: PHP Warning: session_start(): Failed to read session data: user (path: /home/username/tmp/) in /home/username/example.com/file.php on line 212
View the following solution from PHP.net for details on how to resolve this warning.