How to install Php,Mysql and Lighttpd on Ubuntu

Install Lighttpd, PHP and MySQL on Ubuntu

commands to install aptitude and Lighttpd:
$ sudo apt-get update
$ sudo apt-get install aptitude
$ sudo aptitude install lighttpd

Verify that Lighttpd is running: http://localhost/ You should see a default placeholder webpage.

Installing MySQL:
$ sudo aptitude install mysql-server mysql-client

$ sudo aptitude install php5-cgi php5-dev php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ps php5-pspell php5-recode php5-snmp php5-tidy php5-xmlrpc php5-xsl php5-common php5-mysql

modify this file: /etc/php5/cgi/php.ini
$ sudo pico /etc/php5/cgi/php.ini

Inside the file look for the following line:

Change it to this:
Save and exit the file.

Finally here are the last few commands to enable the PHP configuration and FastCGI module as well as reloading the Lighttpd web server:
$ sudo lighty-enable-mod fastcgi
$ sudo lighty-enable-mod fastcgi-php
$ sudo service lighttpd force-reload

1. The Lighttpd default document root (On Ubuntu 10.10) is located at: /var/www
2. The lighttpd.conf file (On Ubuntu 10.10) is located at: /etc/lighttpd/lighttpd.conf

Create a new file called info.php in the /var/www folder:
sudo pico /var/www/info.php

Add this code to the new file and then save and exit.

Browse to http://localhost/info.php to examine all the PHP info.