Magento and PHP 7 Docker Upgrade

created December 11, 2018, last updated June 12, 2019.

closeThis post was last updated 4 years 10 days ago, some of the information contained here may no longer be actual and any referenced software versions may have been updated!

With the demise of Magento 1.x on the horizon – Adobe announced in September 2018 support for version Magento 1 will cease in 2020 new life has been breathed into the product with version

Magento Open Source v1 covering Magento versions up to 1.9.x is still the eCommerce platform for many small businesses and whilst we all know we need to move to Magento 2 the time and resources required to migrate a successful v1 shop to v2 are for many people prohibitive.


The original system requirements for Magento 1 were based on PHP5. Magento 1 users were forced to stay with an operating system that distributed PHP5, a PHP upgrade would break Magento. There were unofficial patches available that would make Magento compatible with later versions of PHP but I was always wary of applying unofficial core code changes to my live shops.

In September 2018 Magento made the PHP7 patches official, and they were included in the December update.

My Magento live Shops were built on Ubuntu Trusty 14.04 LTS which included PHP5. My Docker containers used Trusty as the main OS for my docker images. Now, with the update we can move to current versions of PHP and enjoy the performance benefits of PHP7.x.


As a big fan of Ubuntu I usually build my Ubuntu Docker containers using the Phusion Ubuntu base image. For my Magento2 containers I compile PHP myself so for Magento it was pretty easy to migrate a Magento2 Dockerfile to use for Magento1 on PHP 7.2.


Upgrading my Docker Magento1 PHP5 shops to PHP7 was simply a case of applying the upgrade, replacing my old Ubuntu Trusty base image with the Ubuntu Bionic PHP7.2 image and restarting.

I am still testing all my extensions and associated PHP5 Magento application code for functionality but so far the upgrade looks good.

You can find my Magento PHP7.2 image here. My Dev shop running Magento with PHP7.2 in Docker is here.

Github for the source files is here


This site uses Akismet to reduce spam. Learn how your comment data is processed.