If you are doing any kind of PHP development, you’ll almost always be using Apache along with it. Here’s the quick and easy way to get PHP up and running on your Ubuntu box.

First, you’ll want to add the extra repositories to Ubuntu’s sources.list file.

From a command shell, you will run the following commands:

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

sudo /etc/init.d/apache2 restart

Note that if apache is already installed you can omit the first line. Your web files will now be found in /var/www/

Profile Photo for Lowell Heddings Lowell Heddings
Lowell is the founder and CEO of How-To Geek. He’s been running the show since creating the site back in 2006. Over the last decade, Lowell has personally written more than 1000 articles which have been viewed by over 250 million people. Prior to starting How-To Geek, Lowell spent 15 years working in IT doing consulting, cybersecurity, database management, and programming work.
Read Full Bio »