Win10系统如何搭建Apache和PHP环境?
时间:2023-11-16 14:41:54
很多开发者都会搭建一个Apache和PHP的开发环境,包括很多已经升级了Win10的开发者们。那么在Win10系统中应该如何搭建Apache和PHP环境呢?其方法和Win7/Win8.1差不多,下面就来给大家详细介绍一下。
首先到微软官网下载符合系统位数的Apache和PHP
一、安装并配置Apache
Apache版本:Apache2.4.18
解压目录:D:Acpache24
1、下载回来的是解压文件,解压好放到要安装的位置。
2、打开Apache24\conf下httpd.conf 文件,修改以下关键位置,用记事本打开即可。
ServerRoot修改为Apache程序的位置:
修改前:ServerRoot “c:/Apache24”;
修改前:ServerRoot “D:/Apache24”;
修改Apache默认的网站的根目录:
修改前:DocumentRoot “c:/Apache24/htdocs”;
修改后:DocumentRoot “D:/Apache24/htdocs”;
修改根目录的选项:
修改前:
Options Indexes FollowSymLinks
AllowOverride null
Require all granted
修改后:
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
启动Apache
1、“Win + R”的聊天框输入“cmd”,启动“命令提示窗”。
2、输入 “d:” 回车 ,输入“cd Apache24\bin”回车,输入“httpd”,如果没有任何提示表示启动成功。
3、打开浏览器输入“https://localhost/”进行测试,如下图显示证明配置成功。
二、安装并配置PHP
PHP版本:php5.6.12
安装目录:d:php
1、下载回来的是解压文件,解压好放到要安装的位置。
2、复制份php.ini-development,并改名为php.ini。
3、打开Apache24\conf下httpd.conf,在最后加上
#php5 support
LoadModule php5_module “D:/PHP/php5apache2_4.dll”
AddHandler application/x-httpd-php .php
PHPIniDir “D:/php/”
4、重启 Apache 服务器。
(安装服务器:1、用管理员身份打开命令提示窗;2、输入“D:”,回车;3、输入“cd Apache24\bin”,回车;4、输入“httpd.exe -k install -n ”Apache24“”,回车,即可安装成功;5、“Win + R” 运行“services.msc”,打开服务窗口,启动“Apache2.4”服务;)
5、删除Apache24/htdocs中其他文件,新建一个index.php,访问出现php的信息就说明php已经成功安装。
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
快狗打车如何叫车?快狗打车叫车的方法步骤
![](https://img.aspxhome.com/file/2023/8/a333018_0s.jpg)
Word中玩转交叉引用的技巧
![](https://img.aspxhome.com/file/2023/1/25001_0s.jpg)
戴尔电脑Win7怎么禁用触摸板?
![](https://img.aspxhome.com/file/2023/1/a276704_0s.jpg)
wps表格如何使用自动计算功能
Word2016软件记忆式键入功能的使用方法教学
![](https://img.aspxhome.com/file/2023/9/30949_0s.png)
excel表格批量合并单元格的教程
ppt幻灯片怎么设置演讲者备注?
![](https://img.aspxhome.com/file/2023/10/a346018_0s.jpg )
Google Earth谷歌地球安装教程 Google Earth谷歌地球怎么安装
![](https://img.aspxhome.com/file/2023/8/a338165_0s.png)
Excel利用if和sum函数求单科成绩大于70分的人数
![](https://img.aspxhome.com/file/2023/0/41610_0s.jpg)
搜狗输入法怎么关闭模糊音?
![](https://img.aspxhome.com/file/2023/8/a339881_0s.jpg)
生不逢时?Surface Laptop你来晚了!
![](https://img.aspxhome.com/file/2023/3/a295192_0s.jpg)
Apple Pencil 为什么需要充电使用?Apple Pencil 值得购买吗?
![](https://img.aspxhome.com/file/2023/6/a197836_0s.jpg)
office2007安装过程出错1327怎么办?
![](https://img.aspxhome.com/file/2023/4/16004_0s.png)
WPS演示怎么建立字体倒影操作方法教学
![](https://img.aspxhome.com/file/2023/5/a182495_0s.jpg)
iOS13.4 beta 2值得升级吗?闪退、卡顿问题有没有改进?
![](https://img.aspxhome.com/file/2023/0/a195780_0s.png)
会做出累加运算
mac怎么开启游戏模式?macbook游戏模式打开方法
![](https://img.aspxhome.com/file/2023/1/a273652_0s.jpg)
Win10专业版任务栏颜色修改教程
![](https://img.aspxhome.com/file/2023/1/a278438_0s.png)
win7怎么用u盘重装系统_win7用u盘重装系统方法步骤教程
![](https://img.aspxhome.com/file/2023/2/a289526_0s.jpg)
word 2013打不开怎么办
![](https://img.aspxhome.com/file/2023/9/19499_0s.jpg)