Wednesday, March 2, 2011

That's how you can install LAMP server in linux

Something most of us do after installing a fresh copy of Linux is to install LAMP server for php development or hosting. For me I usually make Linux go crazy and mess things up that I need to install a fresh copy of Linux so frequently ( Not so so frequently either ! ). Remembering the needed packages is quite hard for a poor memory like mine. So let's do this only once here !

sudo apt-get install apache2 php5 mysql-server php5-mysql phpmyadmin

You will be prompted several times to set a password for mysql-server and to allow phpmyadmin to connect to mysql-server. Now you can restart the server using the following command

sudo /etc/init.d/apache2 restart

If you can see [OK] in the lower right corner of the terminal then you are done and everything should be working. Otherwise google the error you found and most probably you will find the solution ( Would you please share it with us ? )

Something you might want to do is to create a new file and place the following code in it and point the browser to its location

<?php phpinfo(); ?>

That's to check your php installation settings and make sure everything is working correctly. Please don't forget to delete the file especially if you are on a production server.

If you want to make sure your LAMP server is updated every other while you can run the same command with -u add to it

sudo apt-get install apache2 php5 mysql-server php5-mysql phpmyadmin -u

No comments:

Post a Comment