From IT Mission Linux Tips, Hacks, Tutorials, Howtos - Itmission.org

Main: InstallApache2PHP5AndMysqlOnUbuntuUsingAptgetCommand

apt-get install  apache2 php5-mysql libapache2-mod-php5 mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  apache2-mpm-prefork apache2-utils apache2.2-common libapr1 libaprutil1
  libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl
  libplrpc-perl libpq5 mysql-client-5.0 mysql-common mysql-server-5.0
  php5-common
Suggested packages:
  apache2-doc php-pear dbishell libcompress-zlib-perl mysql-doc-5.0 tinyca
Recommended packages:
  mailx
The following NEW packages will be installed:
  apache2 apache2-mpm-prefork apache2-utils apache2.2-common
  libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl
  libmysqlclient15off libnet-daemon-perl libplrpc-perl libpq5 mysql-client-5.0
  mysql-common mysql-server mysql-server-5.0 php5-common php5-mysql


Others:

  cp /etc/apt/sources.list /etc/apt/sources.list.orig
  sed -i -e "s/# deb/deb/g" /etc/apt/sources.list
  echo "deb http://mirror3.ubuntulinux.nl/ dapper-seveas freenx" >> /etc/apt/sources.list
  wget http://mirror3.ubuntulinux.nl/1135D466.gpg -O- | sudo apt-key add -
  apt-get update
  apt-get update
  apt-get install  apache2 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysql php5-mysql php5
  a2enmod php5
  /etc/init.d/apache2 restart

If PHP5 is present on your system, installing php4 will install the php module for apache (version 1.3) and not apache2. To use php4 with apache2, install libapache2-mod-php4

  apt-get update
  apt-get install php4 libapache2-mod-php4 mysql-server libapache2-mod-auth-mysql php4-mysql
  sudo a2enmod php4
  /etc/init.d/apache2 restart
Retrieved from http://www.itmission.org/Main/InstallApache2PHP5AndMysqlOnUbuntuUsingAptgetCommand
Page last modified on January 08, 2008, at 12:25 AM