Following are the steps to get Apache, MySQL and PHP installed on a Ubuntu system.
Installing Apache:
In the terminal window issue the following command
1
| sudo apt-get install apache2 |
To test if Apache has installed successfully, open a browser and browse to http://localhost. A message “It works” will be displayed.
Installing PHP
In the terminal window issue the following command
1
| sudo apt-get install php5 libapache2-mod-php5 |
Once the installation is complete, to get php working, restart apache server by issuing the following command
1
| sudo /etc/init.d/apache2 restart |
To test that PHP has been successfully installed, quickly create a test PHP script
1
| sudo gedit /var/www/test.php |
In the gedit window, type a script and save the file
Open up a browser window and open the test.php file created. The PHP application environment information will be displayed.
Installing MySQL
In the terminal, run the following command
1
| sudo apt-get install mysql-server |
That should get mysql installed. You will be prompted for a ‘root’ db user password. Enter it.
To test mysql, in the terminal issue,
Enter the root user password for mysql server. You will be launched into the mysql prompt.
Installing phpMyAdmin
To install phpMyAdmin, issue the following command at the terminal
1
| sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin |
To test phpmyadmin, open a browser and navigate to http://localhost/phpmyadmin.
Thats it!