How to install Apache together with PHP5 on Ubuntu

Written by Ian Carnaghan · 17 sec read >

How to install Apache together with PHP5 on Ubuntu? This becomes very handy if you wish to do some PHP development on Ubuntu.


  1. Open a new terminal window (CLI)
  2. Execute the following commands:
    sudo apt-get install apache2
    sudo apt-get install php5
    sudo apt-get install libapache2-mod-php5
  3. Now we need to restart Apache so that our changes can take effect. There are two commands for you to choose from
    sudo /etc/init.d/apache2 restart


    sudo service apache2 restart

Last Updated On April 07, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. Profile

Leave a Reply

Notify of