homehowtokbslinksaboutcontactprojectsmusic

Index > Help Tutorials > Linux Apache MySQL PHP
LAMP [Linux Apache MySQL and PHP] setup on ubuntu 10.04 LTS

Setting up lamp should not be hard but sometime it can be tricky, especially php part, sometime you try to open php page from your browser and it start to download the file instea. This is ver short but working solution that I am going to share with your
First of all lets make your self root otherwise you have to use sudo with each command(s)
sudo su
Ok now we can start without password prompt on every single command, so let start by installing MySQL, during installation you will be asked for MySQL root password
aptitude install mysql-server mysql-client -y
Now install apache2
aptitude install apache2 -y
Test it out, open browser and point to your webserver IP address or hostname, the default web directory for apache is /var/www/ if you curious. Next install PHP5
aptitude install php5 libapache2-mod-php5 -y
Restart apache2 and test it out if you want
/etc/init.d/apache2 restart
Create a test page for php and test it out in browser
nano /var/www/phpinfo.php
See the contents of phpinfo.php, I could not place it here because I have php installed on my server and it took that as php codes, which they are. Now open this page in browser, you will see PHP info. Now its time to install MySQL support in PHP5, we need php5-mysql package for this setup, however you can search all available php5 packages by typing aptitue search php5 in you terminal console of your Ubuntu Server, then install package if neccessary
apt-get install php5-mysql -y
Now restart the apache server and test the phpinfo page again, you will see mysql portion at the bottom of the page
/etc/init.d/apache2 restart
We are done with our setup of LAMP here, but phpMyAdmin is a greate graphic tool to manage MySQL databe(s) so why not, you will be asked two question during setup. Answer apache2 for first question, answer No for second question
aptitude install phpmyadmin -y
Now point to your webserver and access phpMyAdmin, http://192.168.1.15/phpmyadmin, of course you will change the IP to yours
Note:- The is not assurance that this setup will work for you, it worked for my as many times I tried