Subscribe to How-To Geek

Installing PHP4 and Apache on Ubuntu

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 php4

sudo apt-get install libapache2-mod-php4

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/

Note that this is nearly the same as installing PHP5, which is the latest version.

| More
This article was originally written on 09/14/06 Tagged with: Adding Software, PHP, SysAdmin, Ubuntu

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Comments (6)

  1. supermansghost

    php4 isn’t going to be supported after the end of this year, I think

  2. The Geek

    Yes, that’s correct, but a ton of people still use it.

  3. Bryce

    i ran all the commands in terminal on Ubuntu 7.10 and it asked for my password then it said couldn’t find package apache2 , what should i do

  4. Ubuntu Beginner

    I installed Linux Ubuntu on 25.7.2008. A fresh copy. I completely fromatted my HD. My computer is working only in Ubuntu. I want to install PHP4 , Apache and MySQL. Can any one suggest me the steps involved in doing so? .

  5. Tucker

    all you have to do, is the commands in the terminal of the page you posted on ^.

    but what i did was:

    sudo apt-get install apache2
    sudo apt-get install php5
    sudo apt-get install mysql(this is the part that always gets me messed up, look it up on google, search sudo apt-get install mysql command for ubunut)
    sudo apt-get install webmin

    there is another one that is like php-mysql, youll have to look that one up, it lets mysql and php communiacate

  6. Chris

    php4 seems not to be there anymore – php5 is good


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Our Friends
Getting Started


About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
conhost.exe
Dpupdchk.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. All Rights Reserved.