Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change 
notification.

The "PHPOnWindows" page has been changed by RichBowen.
http://wiki.apache.org/httpd/PHPOnWindows?action=diff&rev1=14&rev2=15

--------------------------------------------------

  
  Note: Remember that when adding path values in the Apache configuration files 
on Windows, all backslashes such as c:\directory\file.ext must be converted to 
forward slashes: c:/directory/file.ext. A trailing slash may also be necessary 
for directories.
  
- Installing as a CGI binary
+ == Running PHP as CGI ==
  
- You need to insert these three lines to your Apache httpd.conf configuration 
file to set up the CGI binary:
+ You should consult the ยป Apache CGI documentation for a more complete 
understanding of running CGI on Apache.
  
+ To run PHP as CGI, you'll need to place your php-cgi files in a directory 
designated as a CGI directory using the ScriptAlias directive.
+ 
+ You will then need to insert a #! line in the PHP files, pointing to the 
location of your PHP binary:
+ 
- Example #1 PHP and Apache 2.0 as CGI
+ Example #1 PHP and Apache 2.x as CGI
  
  {{{
+ #!C:/php/php.exe
+ <?php
+ phpinfo();
+ ?>
- ScriptAlias /php/ "c:/php/"
- AddType application/x-httpd-php .php
- 
- # For PHP 4
- Action application/x-httpd-php "/php/php.exe"
- 
- # For PHP 5
- Action application/x-httpd-php "/php/php-cgi.exe"
  }}}
- 
- Warning
- 
- A server deployed in CGI mode is open to several possible vulnerabilities. 
Please read our CGI security section to learn how to defend yourself from such 
attacks.
  
  Installing as an Apache module
  

Reply via email to