一、apache 装置设置:
1.装置apache
1.1 下载地点:https://www.apachelounge.com/download/
1.2 将下载的文件解压到你想装置的目次 D:\WAMP
2.设置apache(D:\WAMP\Apache24\conf\httpd.conf)
2.1 修正ServerRoot(效劳器途径) 改成apache的装置目次 ServerRoot "D:/WAMP/Apache24"
2.2 修正ServerName(效劳器称号) #ServerName www.example.com:80这是Apache的效劳器地点,把前面的"#"去掉,把"www.example.com"改成"localhost"
2.3 修正 DocumentRoot(网站的根目次) DocumentRoot "c:/Apache24/htdocs" 改成D:/WAMP/Apache24/www 同时修正htdocs文件夹称号为www
2.4 修正 DocumentRoot 下的<Directory "c:/Apache24/htdocs"> 改成<Directory "D:/WAMP/Apache24/www">
2.5 修正ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/" 为ScriptAlias /cgi-bin/ "D:/WAMP/Apache24/cgi-bin/"
2.6 修正 <Directory "c:/Apache24/cgi-bin"> 为<Directory "D:/WAMP/Apache24/cgi-bin">
3.注册和卸载apache效劳
3.1 注册效劳
最先----运转-----cmd,进入apapche的bin目次下,执行命令:httpd.exe -k install -n "Apache24"
3.2 卸载效劳(先要住手这个效劳)
最先----运转-----cmd,进入apapche的bin目次下,执行命令:httpd.exe -k uninstall -n "Apache24"
二、php 装置设置:
1.装置php
1.1 下载地点:http://php.net/downloads.php
1.2 将下载的 zip 文件解压到指定目次,比方将其解压到 D:\WAMP\php7.2
2.设置php(D:\WAMP\Apache24\conf\httpd.conf)
2.1 设置httpd.conf
2.1.1 增加PHP模块
查找"Dynamic Shared Object (DSO) Support"的部份。大概是在62行四周。并在末了追加以下代码:
LoadModule php7_module D:/WAMP/php7.2/php7apache2_4.dll
2.1.2 增加扩展名
查找"AddType"的部份。大概是在409行四周,并在末了追加以下现行代码:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
2.1.3 指定php.ini设置文件途径
在httpd.conf文件里指定PHP设置文件php.ini的目次,这里定位到httpd.conf文件的未尾,在文本末了面一行增加以下代码:
PHPIniDir "D:/WAMP/php7.2"(这里的"D:/WAMP/php7.2"为php.ini文件寄存的现实途径)
2.1.4 设置DirectoryIndex
查找"DirectoryIndex"的部份,大概在282行,在DirectoryIndex的背面追加一个"index.php"
相干教程:php从入门到通晓
以上就是【php进修】wamp基本环境的搭建的细致内容,更多请关注ki4网别的相干文章!