正确配置WampServer根目录

mooc坑我:https://www.imooc.com/video/3520/0

了解:
快捷键 ctrl + f -> 快速查找
正确配置:
1.修改httpd.conf, 查找 “DocumentRoot ” ,将以下两处设置为指定的根目录

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "指定的根目录"
<Directory "指定的根目录">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options +Indexes +FollowSymLinks +Multiviews

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #
# onlineoffline tag - don't remove
    Require local
</Directory>

2.修改httpd.vhosts.conf

# Virtual Hosts
#
<VirtualHost *:80>
  ServerName localhost
  ServerAlias localhost
  DocumentRoot "指定的根目录"
  <Directory "指定的根目录">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

3.修改WampServer显示,在WampServer的安装目录下找到 wampmanager.iniwampmanager.tpl两个文件,并找到以下内容进行修改

这是 wampmanager.ini 文件
[Menu.Left]
;WAMPMENULEFTSTART
Type: separator; Caption: "Made爄n燜rance燽y燨tomatic" Type: item; Caption: "Localhost"; Action: run; FileName: "C:/Users/Maibenben/AppData/Local/Google/Chrome/Application/chrome.exe"; Parameters: "http://localhost/"; Glyph: 27 Type: item; Caption: "phpMyAdmin 4.7.9"; Action: run; FileName: "C:/Users/Maibenben/AppData/Local/Google/Chrome/Application/chrome.exe"; Parameters: "http://localhost/phpmyadmin/"; Glyph: 28 Type: item; Caption: "Adminer 4.6.2"; Action: run; FileName: "C:/Users/Maibenben/AppData/Local/Google/Chrome/Application/chrome.exe"; Parameters: "http://localhost/adminer/"; Glyph: 28 ;WAMPVHOSTSUBMENU
Type: submenu; Caption: "Your VirtualHosts"; Submenu: myVhostsMenu; Glyph: 3 ;WAMPALIASSUBMENU
;WAMPPROJECTSUBMENU
Type: item; Caption: "指定的根目录"; Action: shellexecute; FileName: "指定的根目录"; Glyph: 2 Type: submenu; Caption: "Apache 2.4.33"; SubMenu: apacheMenu; Glyph: 3 Type: submenu; Caption: "PHP 5.6.35"; SubMenu: phpMenu; Glyph: 3 ;WAMPDBMSMENU
Type: submenu; Caption: "MySQL 5.7.21"; SubMenu: mysqlMenu; Glyph: 36 Type: submenu; Caption: "MariaDB 10.2.14"; SubMenu: mariadbMenu; Glyph: 28 Type: separator; Caption: "3.1.3 - 64bit - Services" Type: item; Caption: "Start All Services"; Action: multi; Actions: StartAll Type: item; Caption: "Stop All Services"; Action: multi; Actions: StopAll Type: item; Caption: "Restart All Services"; Action: multi; Actions: RestartAll Type: separator;
;WAMPPUTONLINE
;Type: item; Caption: "For local test only"; Action: run; FileName: "E:/wamp64/bin/php/php5.6.35/php-win.exe"; Parameters: "test.php";WorkingDir: "E:/wamp64/scripts"; Flags: waituntilterminated; Glyph: 9 ;WAMPMENULEFTEND
[Menu.Left]
;WAMPMENULEFTSTART
Type: separator; Caption: "Made爄n燜rance燽y燨tomatic" Type: item; Caption: "${w_localhost}"; Action: run; FileName: "${c_navigator}"; Parameters: "${c_edge}http://localhost${UrlPort}/"; Glyph: 27 ${SupportDBMS}${phmyadMenu}Type: item; Caption: "${w_phpmyadmin} ${phpmyadminVersion}"; Action: run; FileName: "${c_navigator}"; Parameters: "${c_edge}http://localhost${UrlPort}/phpmyadmin/"; Glyph: 28 ${SupportDBMS}${adminerMenu}Type: item; Caption: "Adminer ${adminerVersion}"; Action: run; FileName: "${c_navigator}"; Parameters: "${c_edge}http://localhost${UrlPort}/adminer/"; Glyph: 28 ;WAMPVHOSTSUBMENU
;WAMPALIASSUBMENU
;WAMPPROJECTSUBMENU
Type: item; Caption: "指定的根目录"; Action: shellexecute; FileName: "指定的根目录"; Glyph: 2 Type: submenu; Caption: "Apache ${c_apacheVersion}"; SubMenu: apacheMenu; Glyph: 3 Type: submenu; Caption: "PHP ${c_phpVersion}"; SubMenu: phpMenu; Glyph: 3 ;WAMPDBMSMENU
Type: separator; Caption: "${c_wampVersion} - ${c_wampMode} - ${w_services}" Type: item; Caption: "${w_startServices}"; Action: multi; Actions: StartAll Type: item; Caption: "${w_stopServices}"; Action: multi; Actions: StopAll Type: item; Caption: "${w_restartServices}"; Action: multi; Actions: RestartAll Type: separator;
;WAMPPUTONLINE
;Type: item; Caption: "For local test only"; Action: run; FileName: "${c_phpCli}"; Parameters: "test.php";WorkingDir: "${c_installDir}/scripts"; Flags: waituntilterminated; Glyph: 9 ;WAMPMENULEFTEND

mooc缺少了第二步,搞xi yin 啊!

    原文作者:K8sCat
    原文地址: https://blog.csdn.net/ken1583096683/article/details/80920961
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞