You need to insert these three lines to your Apache httpd.conf configuration file to set up the CGI binary:
範例 3-7. PHP and Apache 2.0 as CGI
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
If you would like to use PHP as a module in Apache 2.0, be sure to move php4ts.dll to winnt/system32 (for Windows NT/2000) or windows/system32 (for Windows XP), overwriting any older file. You need to insert these two lines to your Apache httpd.conf configuration file to set up the PHP-Module for Apache 2.0:
範例 3-8. PHP and Apache 2.0 as Module
LoadModule php4_module c:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php
注: Remember to substitute the c:/php/ for your actual path to PHP in the above examples.
警告
Don't mix up your installation with dll files from different PHP versions . You have the only choice to use the dll's and extensions that ship with your downloaded PHP version.