php apache配置

Apache官方下载地址:apache_2.0.55-win32-x86-no_ssl.msi  

http://mirror.vmmatrix.net/apache/httpd/binaries/win32/apache_2.0.55-win32-x86-no_ssl.msi

php官方下载地址:php-5.0.5-Win32.zip

http://cn2.php.net/get/php-5.0.5-Win32.zip/from/cn.php.net/mirror

注意,php下载threadsafe版,以免测试不能通过

 

php解压到c盘,改名为php

 

将C:/php加入环境变量

 

在安装成功的Apache目录C:\Program Files\Apache Software Foundation\Apache2.2\conf下找到httpd.conf,在后面添加如下命令:

LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php

AddType application/x-httpd-php .html

也就是增加php所能解析的格式

 

 

测试

 

<html>
<head>
<title>hujiahui</title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

 

放在C:\Program Files\Apache Software Foundation\Apache2.2\htdocs文件夹下,保存为phpinfo.php,然后输入http://localhost/phpinfo.php 测试

你可能感兴趣的:(apache,C++,c,PHP,C#)