WampServer下載地址:http://www.wampserver.com/
WampServer安裝(請按序號點擊)
雙擊WampServer安裝程序
步驟①更改路徑
直接點擊安裝
等待安裝不要點擊Cancel
出現彈窗有打開按鈕的點擊打開,有是按鈕的點擊是,直到安裝成功
(ps:由於我的已經安裝過了步驟可能有點不一樣
MySQL環境變量的配置
1. 先找到mysql.exe所在的完整路徑:E:\wamp64\bin\mysql\mysql5.7.23\bin
2. 我的電腦---右擊---屬性---高級系統設置
3. 編輯系統變量Path
4. 添加變量
(ps:上述是用Win10系統配置;Win7系統Path變量為多個,變量之間用";"隔開)
WampServer 多站點配置
例如:添加test1和test2
如果划橫線部分前有#號,就刪除#號(ps:#號為注釋)
修改系統里的hosts文件:C:\Windows\System32\drivers\etc
127.0.0.1 www.test1.com 127.0.0.1 www.test2.com
在根目錄里新建test1和test2兩個文件夾並且里面各有PHP文件
然后 Restart All Servieces (重啟所有服務)
自定義根目錄
以E:/www為例自定義
1. 修改E:\wamp64\scripts\config.inc.php
// 修改前 $wwwDir = $c_installDir.'/www'; // 修改后 $wwwDir = 'E:/www';
2. 修改apache一>httpd.conf;為了避免想要改回默認的根目錄而忘記原代碼,在前面加#號注釋掉
3. 修改hppd-vhosts.conf
<VirtualHost *:80> ServerName localhost ServerAlias localhost DocumentRoot "${INSTALL_DIR}/www" <Directory "${INSTALL_DIR}/www/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost> //下面是測試的 <VirtualHost *:80> ServerName www.test1.com ServerAlias localhost DocumentRoot "E:/www/test1" <Directory "E:/www/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>
注:重啟所有服務
測試結果