CentOS6.5下安裝配置xampp及相關問題和解決
進入 /opt下
一、xampp:
http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.3/
或者
wgethttp://sourceforge.net/projects/xampp/files/XAMPP%20Linux/1.8.3/xampp-linux-x64-1.8.3-1-installer.run
三、下載完以後,給該檔案添加執行許可權:
chmod +x xampp-linux-x64-1.8.3-1-installer.run
四、安裝xampp:
[root@nginxone src]# ./xampp-linux-x64-1.8.3-1-installer.runWelcome to the XAMPP Setup Wizard.
Select the components you want to install; clear the components you do not want
to install. Click Next when you are ready to continue.
XAMPP Core Files : Y (Cannot be edited)
XAMPP Developer Files [Y/n] :y
Is the selection above correct? [Y/n]: y
Installation Directory
XAMPP will be installed to /opt/lampp
Press [Enter] to continue :
Setup is now ready to begin installing XAMPP on your computer.
Do you want to continue? [Y/n]: y
Please wait while Setup installs XAMPP on your computer.
Installing
0%____50%____100%
#########################################
Setup has finished installing XAMPP on your computer.
Launch XAMPP [Y/n]: y
六、啟動xampp:
[root@nginxone lampp]# /opt/lampp/xampp start
七、停止xampp:
[root@nginxone lampp]# /opt/lampp/xampp stop
這裡在瀏覽器輸入localhost即可見到如下頁面
問題1:如果沒有出現上面的畫面而是這樣的
解決:先找到httpd-xampp.conf (find /opt/ -name httpd-xampp.conf )
如,注釋一行,添加一行,重啟即可
問題2:修改mysql的root密碼,因為預設為空白
解決:先找到mysql (find /opt/ -name mysql)
這裡看到有bin/mysql所以進入命令(/opt/lampp/bin/mysql -uroot -p)不要求輸入密碼。
然後到mysql.user修改root密碼即可。
問題3:修改了mysql的root登陸密碼phpmyadmin不能登陸了
解決:找到config.inc.php檔案(find /opt/ -name config.inc.php)
然後vim /opt/lampp/phpmyadmin/config.inc.php
之後就可以開啟phpmyadmin了
八、添加開機啟動:
ln –s /opt/lampp/xampp /etc/rc.d/init.d/xampp
九、如果執行完上面這條還不能開機自動啟動,再執行下面1條語句。
chkconfig –add xampp
查看
chkconfig –list | grep xampp
十、卸載xampp
/opt/lampp/xampp stoprm -rf /opt/lampp
項目放到在/opt/lampp的htdocs檔案夾下瀏覽器輸入localhost/項目名即可訪問。
好了哦!