Install Apache 2 PHP 5 And Mysql On Ubuntu Using Aptget Command
- Installing Apache2 PHP and MySql
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
- Check http://mirror3.ubuntulinux.nl/ with your current version of Ubuntu before adding the above line
wget http://mirror3.ubuntulinux.nl/1135D466.gpg -O- | sudo apt-key add - apt-get update
- PHP5 with MySql
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
- PHP4 with MySql
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







