My PC runs on Ubuntu. And just thought of configuring Apache2+PHP+MySQL
How do i do that?
https://wiki.ubuntu.com/ was really useful on this account.
Just typed PHP on the search window and it populated few results that took me to,
https://wiki.ubuntu.com/ApacheMySQLPHP?highlight=%28php%29Installing Apache: As root user run,
# aptitude install apache2Installing PHP:As root user run, and i preferred PHP4,
# aptitude install php4Now its the turn for mySQL,
# aptitude install mysql-server
# aptitude install libapache2-mod-auth-mysql
# aptitude install php4-mysqlFor want of GUI admin for mySQL and PHP admin did the following,
# aptitude install phpmyadmin
# aptitude install mysql-adminThen follows the mySQL configuration which am yet to do and jumped to "PHP Configuration to Work With MYSQL"
To achieve this,
# gedit /etc/php4/apache2/php.iniand remove the ";" before the line ";extension=mysql.so"
Commands used for Apache Start/ Stop/ Restart,
# /usr/sbin/apache2ctl start
# /usr/sbin/apache2ctl stop
# /usr/sbin/apache2ctl restart
To check PHP's fine funtioning,
# gedit /var/www/testphp.phpand add php phpinfo(); inside php tag and Save.
On mozilla browser, at http://127.0.0.1/testphp.php or http://localhost/testphp.php, I got the successful output.
This was working fine till i rebooted my PC.
Apache is not actually parsing the php after i rebooted my PC.I believe port 80 used default by Apache was occupied and hence the problem.
# netstat -nap --inet|grep -w 80|grep -i listenused the above command to plot which process is occupying port 80 and killed the process and restarted Apache and it started working fyn :-)
In order to fix this,
# gedit /etc/apache2/ports.confand changed
"Listen 80" to
"Listen 127.0.0.1:81"This will also prevent it from listening for incoming connection attempts.
Now rebooting was not a problem and
http://127.0.0.1:81/ is running without parsing problems.
To be contd....