Upgrade from LAMP to LEMP ubuntu 14.04

I needed to upgrade my Ubuntu 14.04 LAMP (Linux, Apache, MySql, PHP5) stack development machine to a LEMP (Linux, Nginx, MySQL, PHP7).  My first instinct was to turn to the internet and consult the millions of blog posts and forum posts, but they all seem to be lacking vital bit of information I was after in my particular situation.

I have detailed the complete steps I undertook to complete the upgrade.

Remove PHP 5

I wanted to completely remove PHP5 from my workstation.  I found by using the bash command was the best approach

Remove phpMyAdmin

Although this command is not necessarily for removing phpMyAdmin, it appears when you remove php5-mcrypt it removes phpmyadmin.

Remove Apache

Once complete ensure all is clean by executing an autoremove

Our workstation should now be ready for re-configuring it for LEMP.

Install PHP7

It seems that PHP7 is not currently in the default ubuntu repository, so we will need to add a private repository .

Now install all the PHP modules required

Install NGINX

Update NGINX Default site configuration

I just used Gedit to open the file and copied and pasted the configuration over.

Save and close Gedit and now we can test our configuration

We also edit the PHP.ini file

Findcgi.fix_pathinfo without quotation mark. change its value to 0 like this: cgi.fix_pathinfo=0 and save it

Install the new PHP-FPM package

Install phpMyadmin


Follow Me

Gary Woodfine

Helps businesses by improving their technical proficiencies and eliminating waste from the software development pipelines.

A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.
Follow Me

Latest posts by Gary Woodfine (see all)

%d bloggers like this: