////////////////2016/05/23////////////////////
////////////////by xbw/////////////////////////////
///////////////環境 centOS 6.5////////////
首先去xampp官網找一下xampp for linux 的下載鏈接,
https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run
64位的 5.6.21版本,在linux 端輸入
cd /opt ,我們把他下載到opt文件夾下,
輸入
wgethttps://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run
等待下載
[root@iZ28lh28mjgZ opt]# wgethttps://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run --2016-05-23 23:25:25-- https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run Resolving sourceforge.net... 216.34.181.60
Connecting to sourceforge.net|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location:https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run/ [following]
--2016-05-23 23:25:29-- https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run/ Connecting to sourceforge.net|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location:https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run/download [following]
--2016-05-23 23:25:31-- https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run/download Connecting to sourceforge.net|216.34.181.60|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location:http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run?r=&ts=1464017133&use_mirror=jaist [following]
--2016-05-23 23:25:34-- http://downloads.sourceforge.net/project/xampp/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run?r=&ts=1464017133&use_mirror=jaist Resolving downloads.sourceforge.net... 216.34.181.59
Connecting to downloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location:http://jaist.dl.sourceforge.net/project/xampp/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run [following]
--2016-05-23 23:25:35-- http://jaist.dl.sourceforge.net/project/xampp/XAMPP%20Linux/5.6.21/xampp-linux-x64-5.6.21-0-installer.run Resolving jaist.dl.sourceforge.net... 150.65.7.130, 2001:df0:2ed:feed::feed
Connecting to jaist.dl.sourceforge.net|150.65.7.130|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 135161506 (129M) [application/x-makeself]
Saving to: “xampp-linux-x64-5.6.21-0-installer.run”
100%[======================================>] 135,161,506 10.1M/s in 17s
2016-05-23 23:25:52 (7.78 MB/s) - “xampp-linux-x64-5.6.21-0-installer.run” saved [135161506/135161506]
下載完成後
輸入ls查看文件夾下的內容;
[root@iZ28lh28mjgZ opt]# ls
rh xampp-linux-x64-5.6.21-0-installer.run
[root@iZ28lh28mjgZ opt]# chmod 755 xampp-linux-x64-5.6.21-0-installer.run
[root@iZ28lh28mjgZ opt]# sh ./xampp-linux-x64-5.6.21-0-installer.run
./xampp-linux-x64-5.6.21-0-installer.run: ./xampp-linux-x64-5.6.21-0-installer.run: cannot execute binary file
[root@iZ28lh28mjgZ opt]# sudo ./xampp-linux-x64-5.6.21-0-installer.run
----------------------------------------------------------------------------
Welcome 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.
一路y就安裝好了,
接下來就是啟動了,
[root@iZ28lh28mjgZ ~]# /opt/lampp/lampp start
Starting XAMPP for Linux 5.6.21-0...
XAMPP: Starting Apache...fail.
XAMPP: Another web server is already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
我們看到apache start fail了,估計是80端口被占用了,我們查一下
[root@iZ28lh28mjgZ ~]# netstat -anp | grep 80 | grep LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 3613/(squid)
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 3613/(squid)
查了80端口,被pid為3613的進程給占用了,雖然不知道是什麼東西,但是果斷殺掉了。
kill 3613後就好了
[root@iZ28lh28mjgZ ~]# kill 3613
[root@iZ28lh28mjgZ ~]# /opt/lampp/lampp start
Starting XAMPP for Linux 5.6.21-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...already running.
XAMPP: Starting ProFTPD...already running.
[root@iZ28lh28mjgZ ~]# /opt/lampp/lampp start
Starting XAMPP for Linux 5.6.21-0...
XAMPP: Starting Apache...already running.
XAMPP: Starting MySQL...already running.
XAMPP: Starting ProFTPD...already running.
已經運行了。