WampServer, la plate-forme de développement Web sous Windows – Apache, MySQL, PHP
WampServer就是Windows Apache Mysql PHP集成安装环境,即在window下的apache、php和mysql(或mariadb)的服务器软件。
安装好wampserver之后,默认的网页程序目录是 www 文件夹。
如果需要修改成其它目录,需要修改httpd.conf 的 documentRoot的配置:
# DocumentRoot "${INSTALL_DIR}/www" DocumentRoot "c:/projects/php" <Directory "c:/projects/php/"> Options +Indexes +FollowSymLinks +Multiviews AllowOverride all # # Controls who can get stuff from this server. # # onlineoffline tag - don't remove Require local </Directory>
如上,默认的路径不wamp安装目录下面的www,即”${INSTALL_DIR}/www”,修改成 “c:/projects/php/”,那么访问localhost即可访问php目录。
当然,只修改httpd.conf是不够的,同样还要需要修改 httpd-vhosts.conf。该文件路径在:C:\wamp64\bin\apache\apache2.4.23\conf\extra 目录,或者你可以通过wamp控制面板访问。
同样注释原路径,添加新路径。
# Virtual Hosts # <VirtualHost *:80> ServerName localhost # DocumentRoot c:/wamp64/www DocumentRoot c:/projects/php <Directory "c:/projects/php/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost> #