1.WampServer:window+apache+mysql+php的版本信息
wampserver3.0.6_x64_apache2.4.23_mysql5.7.14_php5.6.25-7.0.10
安裝在F:\wamp64目錄下。
2.關於WampServer的服務控制面板的修改
1)自定義網站根目錄:
http.conf文件和httpd-vhosts.conf下找到DocumentRoot:
DocumentRoot "${INSTALL_DIR}/www" 修改為:DocumentRoot "你想要的路徑"
<Directory "${INSTALL_DIR}/www/"> 修改為:<Directory "你想要的路徑">
新版本的WampServer的配置文件,提供了很多全局定義的默認配置!就相當於把上述的配置做如下修改:
DocumentRoot "${INSTALL_DIR}/www" 修改為:DocumentRoot "${INSTALL_DIR}/Demo"
<Directory "${INSTALL_DIR}/www/"> 修改為:<Directory "${INSTALL_DIR}/Demo">
在http.conf文件中關於${INSTALL_DIR}的值為WampServer的安裝目錄F:\wamp64。修改的這兩個地方。其實就是網站根目錄,即網站項目的存放的地方。
當然WampServer服務控制面板也要做相應的修改:wampmanager.ini和wampmanager.tpl。
更改wampmanager.ini文件中[Menu.Left]標記中Type: item; Caption: "www Directory";Action: shellexecute; FileName: "F:/wamp/www";
這一句中的Caption值"www Directory"為"Demo",並更改FileName值"F:/wamp/Demo"為目標文件夾,也就是你想要的路徑。
更改wampmanager.tpl文件中[Menu.Left]標記中Type: item; Caption: "${w_wwwDirectory}"; Action: shellexecute; FileName: "${wwwDir}";
這一句中的Caption值 "${w_wwwDirectory}"為"Demo",更改FileName值"${wwwDir}"為"F:/wamp/Demo"為目標文件夾,也就是你想要的路徑。
關於${wwwDir}還可以在F:\wamp64\scripts的config.inc.php中找到!
2)WampServer多站點配置:
http.conf文件中引入httpd-vhosts.conf文件:即#include conf/extra/httpd-vhosts.conf,將#符號去掉。
打開httpd-vhosts.conf:添加域名和路徑,即ServerName和DocumentRoot。
<VirtualHost *:80> ServerName test01.com DocumentRoot F:/wamp64/Demo/test01 <Directory "F:/wamp64/Demo/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost> <VirtualHost *:80> ServerName test02.com DocumentRoot F:/wamp64/Demo/test02 <Directory "F:/wamp64/Demo/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost>
在路徑中寫index.php等驗證文件,如果為其他名字test.php,需在http.conf文件中dir_module中添加test.php
最后在C:\windows\System32\drivers\etc\hosts文件中添加域名
127.0.0.1 test01.com
127.0.0.1 test02.com
3)自擬定端口號
打開http.conf文件,找到Listen 80 和 ServerName localhost:80,apache默認端口號為80,若被占用,可以修改為其他如8080端口等。
3.一打開phpMyAdmin,就在開頭界面中修改了密碼。如下:
phpMyAdmin:密碼:6fXQkbuLCmyxLpfj 即123456的Native MySQL authentication編碼。
修改phpMyAdmin密碼的SQL語句:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '***' 。
通過上面的方法修改密碼后:mysql數據庫中的user表的password字段會變成authentication_string。所以你再次使用密碼登錄時會出現問題。
解決辦法:
這個時候就需要跳過權限進入數據庫了,可以通過命令mysqld --skip-grant-tables,也可以在my.ini配置文件中的[mysqld]中添加skip-grant-tables。
通過上述命令或者配置,就可以無密碼登錄進mysql中了。
然后通過如下語句修改密碼:update mysql.user set authentication_string=password('修改的密碼') where user='root';
修改完flush privileges刷新權限,或在my.ini配置文件中的[mysqld]中刪除skip-grant-tables。退出就可以了。
上述情況中,如果碰到mysql服務不能開啟或者是wampmysql64服務不能開啟,這會導致WampServer一直是黃色。
解決辦法就是:將wamp64\bin\mysql\mysql5.7.14\data下的ib_logfile0,ib_logfile1等往下的所有文件刪除,
並將my.ini的log-bin=mysql-bin這條語句注釋掉,net start wampmysql64 重啟服務就好了。