http://cn.php.net/manual/en/install.windows.apache2.phpInstalling as a CGI binary
You need to insert these three lines to your Apache httpd.conf configuration file to set up the CGI binary: Example 6-5. PHP and Apache 2.0 as CGIScriptAlias /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 
By using the CGI setup, your server is open to several possible attacks. Please read our CGI security section to learn how to defend yourself from those attacks.
 Installing as an Apache module
You need to insert these two lines to your Apache httpd.conf configuration file to set up the PHP module for Apache 2.0: Example 6-6. PHP and Apache 2.0 as Module# For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2.dll"
# Don't forget to copy the php4apache2.dll file from the sapi directory!
AddType application/x-httpd-php .php# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php# configure the path to php.ini
PHPIniDir "C:/php"
 
 
Note: Remember to substitute your actual path to PHP for the c:/php/ in the above examples. Take care to use either php4apache2.dll or php5apache2.dll in your LoadModule directive and not php4apache.dll or php5apache.dll as the latter ones are designed to run with Apache 1.3.x. Note: If you want to use content negotiation, read related FAQ. 

解决方案 »

  1.   

    叹,我还是不明白,可不可以用中文具体来说明一下啊.
    我在网上也找过很多有关PHP安装、配置的教程,可是使用环境、版本都不同.
    我搞了好久,到现在都不能成功地安装.
      

  2.   

    上面的话,大概意思是如果把PHP作为a CGI binary的
    在httpd.conf中添加以下几行ScriptAlias /php/ "c:/php/"
    AddType application/x-httpd-php .php对于PHP5,再添加
    Action application/x-httpd-php "/php/php-cgi.exe"
    如果要作为Apache module的
    对于PHP5,在httpd.conf中添加LoadModule php5_module "c:/php/php5apache2.dll"
    AddType application/x-httpd-php .phpPHPIniDir "C:/php"
    当然,上面的路径要根据实际情况修改
      

  3.   

    作为Apache module
    对于PHP5,在httpd.conf中添加
    LoadModule php5_module "c:/php/php5apache2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/php"
    -----------------------------------------------------------------
    谢谢,我有点明白了,试了好多次,还是没成功.
    我不知道在httpd.conf文件中的哪个地方添加,是在文件头还是尾,
    还是在别的什么地方,网上很多教程也没有说明这一点.我现在刚接触PHP,很菜鸟.
    可否再说详细点,非常感谢!
      

  4.   

    终于配成功了!!
    starwalker ,谢谢您了!!
      

  5.   

    学习PHP,英文不好是不行的.努力吧...............