How to install Apache+MySQL+PHP in Ubuntu 10

On March 4, 2011, in Apache, MySQL, PHP, Ubuntu, by lucasterdev

1. Install MySQL

sudo apt-get install mysql-client mysql-server

2. Install Apache2

sudo apt-get install apache2

Now go to http://localhost and you should see the following:

3. Install support for PHP

sudo apt-get install php5 libapache2-mod-php5

4. Restart Apache

sudo /etc/init.d/apache2 restart

5. Install php5-mysql and other useful stuff

sudo apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json

6. Restart Apache

sudo /etc/init.d/apache2 restart

7. Install phpmyqdmin

sudo apt-get install phpmyadmin

WARNING! You must select apache2 when requested, by pressing the space-bar and make sure there is a '*' next to apache2!!!! Otherwise phpmyadmin will install in another folder.

8. Restart Apache

sudo /etc/init.d/apache2 restart

Apache will start automatically when you boot your computer.

The commands to controll Apache are te following:

sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2 stop

To change Apache’s default port:

sudo gedit /etc/apache2/ports.conf

and change Listen 80 to Listen 79, for instance. Then, restart Apache:

sudo /etc/init.d/apache2 restart
 

Leave a Reply