Friday, October 8, 2010

Apache-MySQL-PHP

Ubuntu Release 10.04(lucid)

(install apache webserver)
sudo apt-get install apache2

(to test apache)
http://localhost/

(install php and its apache module)
sudo apt-get install php5 libapache2-mod-php5

(restart apache)
sudo /etc/init.d/apache2 restart

(to test php)
1.(create testphp.php in DocumentRoot Folder given in /etc/apache2/sites-available/default)
gksudo gedit /var/www/testphp.php

2.(add this line to testphp.php)
<?php phpinfo(); ?>

3.(test whether the phpfunction gets executes)
http://localhost/testphp.php

(install mysql)
sudo apt-get install mysql-server

(to make the mysql services visible on this ipaddress for the network)
(open my.cnf)
gksudo gedit /etc/mysql/my.cnf
(change bind address)
bind-address = 192.168.1.2

(install phpmyadmin and mysql modules for apache and php)
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

(enable mysql for php)
(open php.ini)
gksudo gedit /etc/php5/apache2/php.ini
(uncomment ;extension=mysql.so)
extension=mysql.so

(restart apache)
sudo /etc/init.d/apache2 restart