如果想要快速的部署PHP的环境,你可以选择lnmp.org的LNMP一键安装包。
但是,缺点也很明显,安装过程虽然一键自动化,但是解压、编译,非常耗时。

另一个方式是采用XAMPP。

XAMPP的官方网站是:
https://www.apachefriends.org/zh_cn/index.html

最新版本的Linux安装包的下载链接为:
https://www.apachefriends.org/xampp-files/5.6.23/xampp-linux-5.6.23-0-installer.run

下载完成后,上传软件到服务器:

[root@lnmpme ~]# mkdir /software
[root@lnmpme ~]# cd /software/
[root@lnmpme software]# ls
[root@lnmpme software]# 
[root@lnmpme software]# ls -ltr
total 128324
-rw-r--r-- 1 root root 131401957 Aug  4  2016 xampp-linux-x64-7.0.8-0-installer.run
[root@lnmpme software]# 
[root@lnmpme software]# du -sh *
126M    xampp-linux-x64-7.0.8-0-installer.run
[root@lnmpme software]# 

赋予执行权限:

[root@lnmpme software]# chmod 755 xampp-linux-x64-7.0.8-0-installer.run 
[root@lnmpme software]# ls -ltr
total 128324
-rwxr-xr-x 1 root root 131401957 Aug  4  2016 xampp-linux-x64-7.0.8-0-installer.run
[root@lnmpme software]# 

安装:

[root@lnmpme software]# ./xampp-linux-x64-7.0.8-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.

[root@lnmpme software]# 

启动:

[root@lnmpme software]# cd /opt/lampp/
[root@lnmpme lampp]# ls
apache2  cgi-bin             docs   htdocs  include  lib       logs                   manual   pear        proftpd         RELEASENOTES  temp           var
bin      COPYING.thirdparty  error  icons   info     libexec   man                    modules  php         properties.ini  sbin          uninstall      xampp
build    ctlscript.sh        etc    img     lampp    licenses  manager-linux-x64.run  mysql    phpmyadmin  README-wsrep    share         uninstall.dat
[root@lnmpme lampp]# 
[root@lnmpme lampp]# ./lampp status
Version: XAMPP for Linux 7.0.8-0
Apache is running.
MySQL is not running.
ProFTPD is not running.
[root@lnmpme lampp]# 
[root@lnmpme lampp]# ./lampp stop
Stopping XAMPP for Linux 7.0.8-0...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...not running.
[root@lnmpme lampp]# 
[root@lnmpme lampp]# ./lampp start
Starting XAMPP for Linux 7.0.8-0...
XAMPP: Starting Apache...ok.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
[root@lnmpme lampp]# 

浏览器查看:

[root@lnmpme lampp]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:87:3A:90  
          inet addr:192.168.232.180  Bcast:192.168.232.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe87:3a90/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:130543 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17987 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:138913581 (132.4 MiB)  TX bytes:1323837 (1.2 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:668 (668.0 b)  TX bytes:668 (668.0 b)

[root@lnmpme lampp]# 

URL:
http://192.168.232.180
xampp_1

测试PHP:

[root@lnmpme ~]# cd /opt/lampp/
[root@lnmpme lampp]# 
[root@lnmpme lampp]# ls
apache2  cgi-bin             docs   htdocs  include  lib       logs                   manual   pear        proftpd         RELEASENOTES  temp           var
bin      COPYING.thirdparty  error  icons   info     libexec   man                    modules  php         properties.ini  sbin          uninstall      xampp
build    ctlscript.sh        etc    img     lampp    licenses  manager-linux-x64.run  mysql    phpmyadmin  README-wsrep    share         uninstall.dat
[root@lnmpme lampp]# 
[root@lnmpme lampp]# cd htdocs/
[root@lnmpme htdocs]# 
[root@lnmpme htdocs]# ls
applications.html  bitnami.css  dashboard  favicon.ico  img  index.php  webalizer
[root@lnmpme htdocs]# 
[root@lnmpme htdocs]# vi me.php
[root@lnmpme htdocs]# 
[root@lnmpme htdocs]# ls -ltr
total 60
-rw-r--r--  1 root   root   30894 May 11  2007 favicon.ico
-rw-r--r--  1 root   root     260 Jul  9  2015 index.php
-rw-r--r--  1 root   root     177 Apr  1 22:04 bitnami.css
-rw-r--r--  1 root   root    3619 Apr  1 22:04 applications.html
drwxr-xr-x  2 daemon daemon  4096 Aug  3 22:54 webalizer
drwxr-xr-x  2 root   root    4096 Aug  3 22:54 img
drwxr-xr-x 20 root   root    4096 Aug  3 22:54 dashboard
-rw-r--r--  1 root   root      20 Aug  3 23:04 me.php
[root@lnmpme htdocs]# 
[root@lnmpme htdocs]# cat me.php 

[root@lnmpme htdocs]# 

URL:
http://192.168.232.180/me.php
xampp_2

————————————
Done。

2
说点什么

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Adamhuan Recent comment authors

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

  Subscribe  
提醒
Adamhuan
游客

图形化的管理XAMPP:
[root@adamhuan-info-center lampp]# export DISPLAY=192.168.92.1:2.0
[root@adamhuan-info-center lampp]# xhost +
access control disabled, clients can connect from any host
xhost: must be on local machine to enable or disable access control.
[root@adamhuan-info-center lampp]#
[root@adamhuan-info-center lampp]# pwd
/opt/lampp
[root@adamhuan-info-center lampp]#
[root@adamhuan-info-center lampp]# ./manager-linux-x64.run
[root@adamhuan-info-center lampp]#

trackback

[…] Xampp:Install on RHEL6 […]