Tuesday, 6 March 2012

PHP Installation Error

I recently installed Apache 2.2 web server with PHP 5. The installation of both were successful. However when I created a index.php with phpinfo() and tried to access the page the PHP script was not executed instead of that I saw the PHP code in the browser. After couple of days I stopped the Apache web server and restarted and then I couldn't start it and got the following errors.

First error (marked in red) is due to the lack of file php5apache2_2.dll in the Apache2.2 directory. I copied this file from PHP installation directory to Apache installation directory. I tried to start Apache with httpd. I got the second error.

Second error (marked in purple) is due to lack of path in the Apache configuration file httpd.conf (localted in conf directory of Apache installation folder). I updated the path by giving correct PHP installation location for variable 'PHPIniDir' in httpd.conf file. I am able to start the Apache successfully. I accessed index.php and I can see the page!

No comments:

Post a Comment