Friday, October 10, 2008

Install Apache, MySQL, PHP and PHPMyAdmin on Ubuntu

First we have to install Apache. Open a terminal (Applications >> Accessories >> Terminal). Then type the following command.
  • sudo apt-get install apache2
After compleated that you can test for apache. Open your web browser and try to access the following URL.
  • http://localhost
If you have successfully installed that then you can see some text on your browser.

Then we can install PHP. Run following command on terminal for that.
  • sudo apt-get install php5
Now we have to install MYSQL. Use following command for that.
  • sudo apt-get install mysql-server
To administrate MYSQL you have to use PHPMyAdmin, which is an web based interface for this purpose. To do that run following command on terminal.
  • sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
While installing this it may ask you to select the webserver. then you have to select "apache2".

Finally you have to set the path for PHPMyAdmin. Follow the following steps,
  • sudo gedit /etc/apache2/apache2.conf
Then insert the following line and save it.
  • Include /etc/phpmyadmin/apache.conf
Then restart the apache,
  • sudo /etc/init.d/apache2 restart
Then try to access phpMyAdmin using web browser,
  • http://localhost/phpmyadmin/
Thats it..! :)

No comments :