logo
Published on Technical articles on: Windows servers, Apache Web Server, MySQL, PHP, IIS (http://www.sitebuddy.com)

Install PHP in CGI mode on Apache 2.x

By chris
Created 17 Nov 2006 - 7:42pm

Running PHP in CGI mode on Apache 2.x

I was running PHP as a module under Apache and decided to try the cgi mode. The instruction all over the web are pretty simple.
Add the following to your httpd.conf:

ScriptAlias /php52/ "E:/A22/php520/"
SetEnv PHPRC "E:/A22/php520/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php52/php-cgi.exe"

The SetEnv line is useful to indicate were to look for your php.ini first.

Well that might work for you, but it did not for me. Here are the additional steps I had to take:

LoadModule actions_module modules/mod_actions.so
LoadModule env_module modules/mod_env.so
LoadModule alias_module modules/mod_alias.so
LoadModule cgi_module modules/mod_cgi.so

Done with the modules.

<Directory "E:/A22/php520/">
Options ExecCGI 
Order allow,deny
Allow from all
</Directory>

Source URL:
http://www.sitebuddy.com/php/install_PHP_in_CGI_mode_on_Apache_2