How to perform a basic PHP Installation
Within this article we will be configuring a basic php installation using Apache.
Note : The steps are based upon the CentOS 5 distro.
Install Apache / PHP
First of all you will need to install Apache and php via yum.
yum install httpd php
Within /etc/php.ini ensure the following settings are configured by either un-commenting them or by changing the appropriate value.
short_open_tag = On
magic_quotes_gpc = On
register_globals = On
session.save_path = "/var/lib/php/session"
Edit the Apache configuration to ensure the following configuration settings are set.
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so
AddType applications/x-httpd-php .php
AddType applications/x-httpd-php-source .phps
Create PHP Script
Create a small php script and save it within the directory /var/www/html/. A small example is shown below.
Note : When creating php scripts all code should be enclosed within php tags such as <?php [syntax] ?>.
To confirm that the installation and configuration was successful run the test PHP script.
http://[server address]/[testscript name].php