PHP7 Magento

What to Know About Upgrading to PHP7

PHP7 is here and our developers noticed some impressive speed improvements right off the bat. It’s important to keep your Magento server up-to-date for security and performance, but we recommend upgrading to PHP7 for noticeable Magento performance improvements. After some benchmark testing, we noticed a 70% decrease in page load time and 30% less memory consumption across the board on a base installation of Magento 1.9.

Our Lead Developer wrote some simple directions on upgrading to PHP7 from PHP5 on Ubuntu. These should be performed by a developer or system admin – Contact us for help on upgrading to PHP7 on any Magento install.

There’s only a couple of minor quirks, like not having dl() support which killed a couple of the extensions that had copy-protection on one site.  There are a couple of minor things to do to make PHP7 work but it’s covered below.

If you’re ready to take the Magento/PHP7 plunge and are using Ubuntu, then this is how you can do it:

  1. Remove PHP5 (Warning: This will remove PHP5 from your system completely.)
    • sudo apt-get purge php5-*
  2. Add the PHP7 repository
    • sudo add-apt-repository ppa:ondrej/php
    • sudo apt-get update
  3. Install PHP7
    • sudo apt-get install php7.0
  4. Install PHP7 components 
    • sudo apt-get install php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm php7.0-curl php7.0-json php7.0-cgi php7.0-mcrypt
    • sudo service php7.0-fpm restart
    • sudo service apache2 restart
  5. The Magento PHP7 Fix

Here are some common problems with Magento after installing PHP7 – 

  • If Apache is dumping plain text php instead of rendering it, then be sure that you’ve installed libapache2-mod-php7.0.
    • sudo apt-get install libapache2-mod-php7.0
    • sudo service php7.0-fpm restart
    • sudo service apache2 restart
  • Getting a white page or error about mcrypt in Magento?
    • sudo apt-get install php7.0-mcrypt
    • sudo service php7.0-fpm restart
    • sudo service apache2 restart

Still not feeling confident? If you aren’t ready for upgrading to PHP7 on your own, give the experts at InteractOne a call today at (513) 469-7042 or fill out our contact form.