Skip to content
PHP7 + Joomla 3.5

Blog

Overview: Make your website two times faster with the help of PHP 7 and Joomla! 3.5.

Rene Korss

17.05.2016

PHP 7 was released on December 3rd 2015 and Joomla! 3.5 in March 2016. At the time of writing this blog post, the last version of PHP is 7.0.6. The release of new Joomla! version is taking longer than expected, caused by problems in database coding and other minor errors. These weren’t changes arising due to PHP 7. They were ready for these much earlier. Joomla! 3.5 has been out for almost two months and errors have been corrected.

We have updated the websites of many our clients to the newest CMS version and it has revealed very good results. In order to increase speed and performance, the best option is to update the website or application to the newest CMS and PHP version. Let’s take the example of performance improvement of our own website. It is remarkable that the effect is caused only by the updated version, changes in code etc were not made.

Memory usage and loading time before (PHP 5.6 and Joomla! 3.4.8)

Mälukasutus ja laadimisaeg enne (PHP 5.6 ja Joomla! 3.4.8)

Memory usage and loading time after (PHP 7 and Joomla! 3.5.1)

Mälukasutus ja laadimisaeg pärast (PHP 7 ja Joomla! 3.5.1)

It can be seen that the loading processes are remarkably quicker. In the following table the loading of afterInitialise, afterRoute and afterDispatch processes are measured, since these are a few of the most important in Joomla! lifecycle.

PHP 5.6PHP 7
afterInitialise79.3ms51.8ms
afterRoute12.3ms6.32ms
afterDispatch43.8ms1.01ms
Kokku135.4ms59.13ms

It is clear that loading these processes is more than 2x quicker when using PHP 7.

The overall memory usage with PHP 5.6 is ~8MB and with PHP 7 ~5MB. That is a 3MB win which means 37.5% saved memory, leaving more memory to other processes. The result is an application that can process more inquiries at the same time. So, the application can serve more clients at the same time (increase of application scalability).

The compatibility of additional programs with the new version.

In order to make sure Joomla! 3.5 is compatible with PHP 7, a small but important adjustment had to be made that could stop the work of additional programs. More specifically, PHP class String was renamed StringHelper because String is a protected class name since PHP 7.

Most common additional programs are adjusted or didn’t need adjusting and work fine. But that doesn’t mean that a Joomla! website that is available to clients should be updated hastily. A test version needs to be created in order to update the page and test everything to make sure it works as usual. If you need help with updating and want to do it 100% hassle-free, feel free to contact us.

PHP versions

  • PHP 5.3 – not supported – should not be used anymore.
  • PHP 5.4 – not supported – should not be used anymore.
  • PHP 5.5 – security updates will be provided until the end of July 2016.
  • PHP 5.6 – will be developed until the end of the year, security updates will be provided 2 years after that.
  • PHP 7 – will be supported until the end of 2018 and security updates will be provided after that

If your website or application runs on a PHP version that is older than 5.6, we strongly recommend to update PHP because security breaches will not be fixed and when they occur, the website and files in the server are in danger. Of course, we also recommend to update the 5.6 version because the increase in speed and saving on memory usage is remarkable. From the comparison above, it can be concluded that the loading time decreases 2x and memory usage ~40%.

We’d love to help in the updating process and we can take the whole process upon ourselves. It is important to know that old applications (mostly special solutions) could need changes in code (we can help with that as well), in order to support the newest PHP version. The most common CMS-es shouldn’t cause problems since the support is already added, but it is still worth checking from the official website.

Should there be a wish to update and/or develop, contact us.