Install PHP in CGI Mode to Apache 2.0:
Insert the following command into the httpd. conf configuration file of Apache to set the CGI binary file:
ScriptAlias/php/"c:/php /"
AddType application/x-httpd-php. php
Action application/x-httpd-php "/php/php.exe"
Install PHP in modules to Apache 2.0:
Move php4ts. dll or php5ts. dll to winnt/system32 (Windows NT/2000) or windows/system32 (Windows XP ). Insert the following two rows to httpd. conf.
; For PHP 4 do something like this:
LoadModule php4_module "c:/php/php4apache2. dll"
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
Test Apache:
Open your browser and enter http: // localhost/or http: // 127.0.0.1/in the address bar. If the Apache page "It works." appears, It means that Apache is working properly.
Test PHP settings:
Write a PHP page and enter the following code:
<Html>
<Head>
<Title>
Hello
</Title>
</Head>
<Body>
<? Php echo "hello, php";?>
<P> php5 is work! </P>
</Body>
</Html>
Save this file ***. php is stored in the htdocs directory of Apache (it can be stored in http. in the conf file), open the browser, and enter http: // localhost/*** in the address bar /***. php or http: // 127.0.0.1 /***. php. If *** php is correctly displayed, the PHP configuration is normal.