PHP 7.2 was released on November 30th and is now available to all HostNexus clients in Plesk. It comes almost a year to day since PHP 7.1 was released on December 30 2016.
PHP 7.2.0 introduces many improvements and new features such as:
- Convert numeric keys in object/array casts
- Counting of non-countable objects
- Object typehint
- HashContext as Object
- Argon2 in password hash
- Improve TLS constants to sane values
- Mcrypt extension removed
- New sodium extension
For the average hosting user the new improvements and features will be largely meaningless. The most important thing to know is that a lot of the common PHP based applications like WordPress and Joomla, support PHP 7.2 out of the box. In fact WordPress now lists PHP 7.2 as recommended on its requirements page.
Drupal is working hard to support PHP 7.2 but looking at their bug tracker it’s not quite there yet. Magento still doesn’t support PHP 7.2. Drupal and Magento both support PHP 7.1 though as do all well maintained applications. Which leads me to address the sorry state of affairs of PHP 7 uptake on our fleet of shared hosting servers……
Why You Should Upgrade To PHP 7.x
PHP 7.0 was released 2 years ago on December 3rd 2015. It was also the most important release of PHP to date. Applications with a PHP backend run almost twice as fast. It works more intelligently and uses less memory. Let’s look at some at stats courtesy of Zend:
PHP 7 can handle almost twice as many requests per seconds with 30% lower memory consumption. On shared hosting where memory is limited per account this could mean the difference between staying on your current plan or having to upgrade to a plan with higher resources.
Please Upgrade to PHP 7!
In Plesk we have every PHP version from 5.3 onwards. There’s 5.3, .5.4, 5.5, 5.6, 7.0, 7.1 and now 7.2. When I look around our servers I see so many sites running on PHP 5.3. This version was released in 2009 and EOL’d (end of life) in 2014. It hasn’t received an update for over 3 years. It’s slow. It’s also insecure with 70 known vulnerabilities.
WordPress has interesting statistics available for PHP version usage. It’s pretty bleak.
One in 5 websites (20%) are running on PHP 7. Version 7.2 adoption rates will increase in the next few weeks as users become aware and developers update plugins to support the new version. There is one particular function called “create_function()” that has pretty wide use in the plugin ecosystem.
40% of websites are running on PHP 5.6. This is last of the 5.x release series and the only currently supported 5.x version. However, PHP 5.6 will reach EOL in December 2018.
40% of WordPress websites run on PHP 5.2 to 5.5. No wonder WordPress is the #1 target for malware bots.
Easily Switch To PHP 7.x in Plesk
Switching PHP versions in Plesk couldn’t be easier. Just navigate to Websites & Settings for any domain and you will see PHP Settings.
Click on PHP Settings and you’ll see a drop-down menu for the PHP version and another drop-down menu for the PHP handler.
For now I recommend everyone stick with PHP 7.1.x. This is just to give plugin developers time to update any plugins that might have issues with PHP 7.2.
If you are on a CentOS 6 server ( of which there are many) you will only see FastCGI application served by Apache and FPM application served by Nginx. Please make sure you choose FastCGI application served by Apache. On CentOS 7 servers you will want to choose FPM applicated server by Apache.
If you choose FPM application served by Nginx .htaccess will not work and break most sites.
If you want to update PHP to 7.2 but have concerns about certain parts of your site you can easily clone for WordPress instance to a staging area. It takes a few seconds and then you can update PHP on the staging subdomain to 7.2 and test everything works. In Plesk click on WordPress (menus on right and left of the page as well as at the top of Websites & Domains).
In 2018 I am making it our mission at HN to get everyone switched to PHP 7.x before 5.6 hits its End Of Life at the end of the year. After that we I hope won’t ever have to support a PHP version that is EOL. But more than likely what we may to do is keep one server with old PHP versions available to accommodate clients with code that can’t be upgraded. I will be drawing up a timetable – certain servers in certain months of 2018 and working with everyone to get switched over.
As always if you need help in switching to PHP 7 don’t hesitate to contact your friendly support team. :)