Configuring Apache to Use PHP as CGI on Windows Systems
How to configure Apache server to run PHP engine as CGI on Windows systems?
If you have followed our tutorials and got the Apache server installed and running, got the PHP engine installed and configured, you can now use this tutorial to configure the Apache server to run PHP engine as CGI to support PHP scripts.
1. Assuming that your Apache server is installed at C:\Program Files\Apache Software Foundation\Apache2.2
2. Assuming that your PHP engine is installed at C:\Program Files\php-5.2.0-Win32
3. Use "notepad" to open C:\Program Files\Apache Software Foundation \Apache2.2\conf\httpd.conf
4. Go to alias_module section and define a script directory call /php/ as:
<IfModule alias_module> ... ScriptAlias /php/ "C:/Program Files/php-5.2.0-Win32/" </IfModule>
5. Add an access control section for this directory as:
<Directory "C:/Program Files/php-5.2.0-Win32/"> AllowOverride None Options None Order allow,deny Allow from all </Directory>
6. Go to mime_module section and define a mime type as:
<IfModule mime_module> ... AddType application/x-httpd-php .php </IfModule>
7. At the root level below the LoadModule section, define an "Action" entry:
#LoadModule ssl_module modules/mod_ssl.so Action application/x-httpd-php "/php/php-cgi.exe"
This "Action" entry tells Apache to run "php-cgi.exe" from the script directory "/php/" for any "application/x-httpd-php" mime files.
8. Restart your Apache server.
2015-11-29, 95349👍, 6💬
How to configure IIS to support PHP scripts on your Windows system? If you want to support PHP scrip...
What are required to use wireless routers to connect to the Internet? If you want to connect to the ...
How to use sc.exe command to start and stop an existing service? If you want to start or stop a serv...
Pl help me.. Hi.. how to run a php script in windows xp ...? First, you need to download and install...
How to remove REFIEBAR.DLL - Microsoft Research Extra Toolbar Button and Extra Tools Menu Item for I...