This configure script utilizes the Apache SAPI extension

Apache to Handle PHPNow that PHP is installed, you need to configure Apache to handle PHP files by passing them to the PHP engine for processing. You do this by adding some information into your Apache configuration file, httpd.conf. Here are the steps: 1.At the very end of your httpd.conf file, add the following line: AddType application/x-httpd-php .php .php32.If you wish to enable the source code highlight extension (.phps) for your files, add the fol- lowing below the previous line: AddType application/x-httpd-php-source .phpsNOTEIf you are using mod_ssl with your Apache installation, you might want to find the line thatsays AddModule mod_php5.c and move it below the regular AddModule list instead of allow- ing it to remain in the section. Depending on which version of PHP you areinstalling, this might have already been done for you. 3.Next, there is a directive in Apache called DirectoryIndex and it should be modified to add PHP index files. Locate the following line: DirectoryIndex index.htmlAnd change it to the following: DirectoryIndex index.php default.php index.html index.htm4.Now you are all set to test PHP. First, you need to completely stop and then start Apache to ensure that the PHP module was successfully loaded: apachectl stopapachectl start5.If you are using Apache with mod_ssl, you need to start Apache as follows: apachectl startsslNow your PHP installation should be complete, and all you have to do is test it. Testing the PHP InstallationTo test your PHP installation, you are going to create a simple script that will display the PHP information. If the script is executed and parsed properly, it will display a nice HTML page that is generated by PHP. If it is not executed and parsed properly, it will display the code that you typed into the script. Depending on how much of Chapter 8, Apache Web Server: Installation and Configura- tion, you followed, you might have a virtual host configured. If this is the case, you will need

Note: If you are looking for good and affordable webspace to host and run your servlet application check Virtualwebstudio servlet hosting services

Comments are closed.