Categories: Hosting News

PHP 7 + OpCache Now Available On All Shared SiteGround Servers

UPDATE: PHP 7.0 has Memcached support which you can use for object caching. If you're using our SG Optimizer plugin, it will automatically use the appropriate drop-in.

HHVM has significantly changed the way PHP sites are optimized for performance. Right now it is probably the fastest stable execution engine for PHP scripts. However, with PHP 7 on the horizon things may change and HHVM may face a serious competitor as according to some benchmarking tests and those disclosed by Zend, PHP 7 is much faster than HHVM.

Important: Even though it's stable, PHP 7.0 is still in beta and it's not recommended that you use it on live websites. In addition, it does not yet have Memcache support which means that if you want to use the SuperCacher and PHP7, you need to disable the Memcache option from the plugin backend before switching to PHP7.

Why Should You Use PHP 7?

The main advantage of PHP 7 is that it is much faster than any of the available PHP 5.x releases. The fact that PHP 7 provides opcode caching by default is the main reason for the performance improvements provided by PHP 7.

How To Activate PHP 7 on a SiteGround server?

Here at SiteGround we believe that our clients should have access to the latest technologies as soon as those technologies are stable enough for secure usage. That is why we have added the latest PHP 7 beta version to all our servers.

You can activate PHP 7 directly from the PHP Version Manager in cPanel or by adding a line in your .htaccess file. The PHP 7 OpCache functionality is enabled by default. The folder which is used by PHP 7 to store the opcache is:

If you want to clear the cache you can simply delete the whole .opcache directory.

Are Any Issues Expected?

We have tested default installations of some of the most popular apps (WordPress, Joomla!, Drupal, etc.) and we did not notice issues. However, as PHP 7 is the largest shift in PHP technology since the upgrade to PHP 5.3, issues will occur for sure. In PHP 7 many things have been changed and some functions have been deprecated so developers may check this article by Cal Evans from Zend for more information about the backwards compatibility issues that could occur.

Daniel Kanchev: My challenging job is closely related to all kinds of Free and Open-Source Software products (some of my favorites are WordPress, Joomla!, Magento, Varnish and Apache mod_security). As a Web security and performance freak I am always hyper focused on solving all kinds of issues and improving our services.

View Comments

  • I am now using PHP 7 beta 3 and apparently it is working fine but I don''t see performance improvement.

    Now there is already PHP 7 RC 2 and on September 17, it will be released PHP 7 RC 3.

    PHP 7 Beta 3 is already two version old, when do you plan to give us a newer version of PHP 7 ?

    Thank you

    • It takes time to implement a new PHP version on a big hosting structure like ours :) However, we will make a newer version available very soon.

  • I've been with many other hosting companies but I did not last long and for a lot of technical and features reasons which Siteground resolved! I am not moving anywhere, anytime soon!

    Before moving to SG, I took the time to test my existing site speed, and support and when I moved, there was a big difference between SG and my previous hosting!

    You guys are great and if you continue to be the best at what you do, you might have to rent a bigger office/building to make room for more SG team!

  • Hey SG,

    i think to have PHP 7 with Opcache on a Shared Hosting Platform will be great,
    From a security point of view: as the Opcache is written in a shared memory. How do you separate "customers opcache memory" in the webservers memory ?


    • We don't use shared memory at all. The cache is stored in the user's home folder and is accessible only by that user.

    • It can be installed on your server upon request. Just post a ticket in your Help Desk :)

  • Do you know if there is a list of compatible plugins for WordPress somewhere?

    Also, it would be great if Memcache could work with PHP 7 at some point :)

    Best regards,

    • If you're using PHP7 you can simply enable the Memcached service from the SuperCaching plugin and the page in cPanel. It will work with memcached instead of memcache but you shouldn't feel any difference. As to the plugins, it's really up to their developers to make them compatible with PHP7 and that's probably a feature that should be added in the official WordPress repo because it would be impossibe for us as a host to gather and organise that information.

  • Yo peeps, I ran PHP 7 and moved back to PHP 5
    ( although PHP 7 is fine, OPCache is fine too but I had too go back for a specific reason )

    But the OPCache was still interferring with the website so I had to flush it SFTP mannually

    root PHP7
    subfloder PHP7 - then - PHP5

    • Maybe the dynamic caching was showing fully cached page content, the OPCcache cannot return data if you switch back to 5. Hope that you will manage to sort your code and move to PHP 7 because it's really way better :)