Jul 01 2008
LAMP Setup on Your Dedicated Server - Step 2 of 3 - Configuring PHP
By now you have already installed Apache onto your dedicated server. Now, let’s configure Apache to run with PHP4 or PHP5, whichever is your preference in scripting.
For PHP4, it’s as simple as apt-get:
apt-get install apache2 php4 libapache2-mod-php4
Since PHP5 can be automatically installed if you don’t specify the package ‘4’, you can do that or apt-get:
apt-get install apache2 php5 libapache2-mod-php5
To test and ensure that you are now hosting with PHP4 or PHP5, create a test file called test.php in /var/www folder with phpinfo() function as follows:
nano /var/www/test.php
# test.php
php phpinfo();
Now, just point your web browser to http://ip.address/test.php and you’ll be able to see your php config and default settings. If you don’t, check with your dedicated server administrators or web hosting provider.
From there, you can also edit necessary values or setup virtual domains, enable CAPTCHA, and more.
