config apache and php in windows

本文详细介绍了如何下载与配置Apache及PHP环境的过程,包括选择正确的版本以匹配主机系统(x86或x64),安装所需的Visual C++ Redistributable组件,解压Apache和PHP到指定目录,配置php.ini与httpd.conf文件,设置Apache查找PHP的位置,并通过浏览器进行测试。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. download related apache and php 
1.1 make sure the version is same with your host(x86 or x64)
1.2 download related vc version
PHP are built with VC9, VC11 or VC14 (Visual Studio 2008, 2012 or 2015 compiler respectively) and include improvements in performance and stability.
- The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86 or x64 installed
- The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed
- The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed
http://windows.php.net/download/
http://www.apachelounge.com/download/VC11/
2. php for windows need thread safe version
3. unzip apache and php to c:\
4. config php.ini
5. config httpd.conf
LoadModule php5_module "c:/php/php5apache2_4.dll"
<IfModule mime_module> section:
AddType application/x-httpd-php .php
let apache find php, add below line to the end of httpd.conf:
PHPIniDir "c:/php"
config index file:
DirectoryIndex index.php index.html
6. write one test.php file, put it under Apache htdocs dir, restart Apache, using browser test it. 
file content:
<?php phpinfo(); ?>
url: 
localhost/test.php
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值