PHP-5.5.10+Apache httpd-2.4.9在Windows系统下配置实战

时间:2023-12-30 13:35:26

原文 PHP-5.5.10+Apache httpd-2.4.9在Windows系统下配置实战

环境配置:

PHP-5.5.10+Apache httpd-2.4.9在Windows系统下配置实战 

程序准备: 
PHP windows版本下载地址:

http://windows.php.net/downloads/releases/php-5.5.10-Win32-VC11-x64.zip

(下载后文件名为php-5.5.10-Win32-VC11-x64.zip)

Apache httpd windows版本下载地址:

http://www.apachelounge.com/download/VC11/binaries/httpd-2.4.9-win64-VC11.zip

(下载后文件名为httpd-2.4.9-win64-VC11.zip,同时需要下载vcredist_x64.exe[http://www.microsoft.com/en-us/download/details.aspx?id=30679]进行安装) 

配置过程: 
1)分别解压PHP和httpd压缩包至C:\wamp; 
2)修改C:\wamp\Apache24\conf\httpd.conf如下参数: 
    ServerRoot "C:/wamp/Apache24"
    LoadModule php5_module "C:/wamp/php-5.5.10/php5apache2_4.dll"
    PHPIniDir "C:/wamp/Apache24"
    DocumentRoot "C:/wamp/Apache24/htdocs"
    <Directory "C:/wamp/Apache24/htdocs">
    ScriptAlias /cgi-bin/ "C:/wamp/Apache24/cgi-bin/"
    DirectoryIndex index.html index.php
    <Directory "C:/wamp/Apache24/cgi-bin">
    AddType application/x-httpd-php .php

3)拷贝C:\wamp\php-5.5.10\php.ini-production至C:\wamp\Apache24重命名为php.ini,并修改如下参数: 
    doc_root =" c:/wamp/Apache24/htdocs"
    extension_dir = "C:/wamp/php-5.5.10/ext"
    extension=php_gd2.dll
    extension=php_mbstring.dll
    extension=php_mysql.dll
    session.save_path = " C:/wamp/php-5.5.10/tmp" 
4)执行命令“C:\wamp\Apache24\bin\httpd.exe”启动Apache httpd服务器。 

验证演示: 
1)在C:\wamp\Apache24\htdocs\新建文件index.php,编辑内容如下:

1
2
3
4
5
6
7
<html>
<body>
<?php
phpinfo();
?>
</body>
</html>

2)在浏览器输入http://127.0.0.1/,可以看到如下PHP相关配置信息,至此说明Windows系统下php-5.5.10+httpd-2.4.9配置已经成功! 
PHP-5.5.10+Apache httpd-2.4.9在Windows系统下配置实战