PHP is installed in the CGI mode to apache 2.0: Insert the following instruction into the apache's httpd.conf configuration file to set the CGI binary: scriptalias / php / "c: / php /" addtype application / x-httpd-php .php Action Application / X-httpd-php "/ php/Php.exe"
PHP is installed in module to Apache 2.0: mobile php4ts.dll or php5tsts.dll to Winnt / System32 (Windows NT / 2000) or Windows / System32 (Windows XP). Insert it in two lines 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 the browser, enter http: // localhost / or http://127.0.0.0.1/, if Apache page can appear in the address bar. "Then, the Apache is working properly. Test PHP setting: Write a PHP page Enter the following code:
php5 Is Work! p> body> html>
The file is stored as ***. PHP is stored in the HTDOCS directory of Apache (can change this directory in the http.conf file), open the browser, enter http: // localhost / *** in the address bar. .php or http://127.0.0.1/***.php, if ***, PHP can display correctly, indicating that the PHP configuration is normal.