XAMPP
XAMPP是一款开源、免费的网络服务器软件,经过简单安装就可以在搭建PHP开发环境。本文为大家介绍ubuntu中安装XAMPP及使用方法的总结。
一、简介
XAMPP(X-系统,A-Apache,M-Mysql,P-php,P-Phpmyadmin/Perl)这个缩写名称说明了XAMPP安装包所包含的文件:Apache web服务器, MySQL数据库, PHP, Perl, FTP 服务程序(FileZillaFTP)和phpMyAdmin简单的说,XAMPP是一款集成了Apache+MYSQL+PHP的服务器系统开发套件,同时还包含了管理MySQL的工具phpMyAdmin,即可对MySQL进行可视化操作。采用这种集成,XAMPP 可以运行任何程序:从个人主页到功能全面的产品站点。
二、安装
下载
xampp下载地址
下载PHP对应的版本:
wget -c https://www.apachefriends.org/xampp-files/7.2.13/xampp-linux-x64-7.2.13-0-installer.run
安装
修改文件模式
chmod +x xampp-linux-x64-7.2.10-10-0-installer.run
./xampp-linux-x64-7.2.10-0-installer.run
验证
三、问题
- mysql没有反应
- 修改外网访问权限
找到配置文件: /opt/lampp/etc/extra/httpd-xampp.conf
修改17行的内容如下:
# since XAMPP 1.4.3
<Directory "/opt/lampp/phpmyadmin">
AllowOverride AuthConfig Limit
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
- 开机启动xampp
vi /etc/init.d/ rc.local
在最后一行加上 /opt/lampp/lampp start - MySQL Server has gone away原因
- Your SQL statement was too large.
mysql> show global variables like 'max_allowed_packet'; mysql> set global max_allowed_packet=1024*1024*16;
四、附录
root@huawei2:/home/yu#
root@huawei2:/home/yu# wget -c https://www.apachefriends.org/xampp-files/7.2.13/xampp-linux-x64-7.2.13-0-installer.run
--2018-12-15 22:36:38-- https://www.apachefriends.org/xampp-files/7.2.13/xampp-linux-x64-7.2.13-0-installer.run
Resolving www.apachefriends.org (www.apachefriends.org)... 107.23.70.193, 34.234.217.31, 18.235.14.163
Connecting to www.apachefriends.org (www.apachefriends.org)|107.23.70.193|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://downloadsapachefriends.global.ssl.fastly.net/7.2.13/xampp-linux-x64-7.2.13-0-installer.run?from_af=true [following]
--2018-12-15 22:36:39-- https://downloadsapachefriends.global.ssl.fastly.net/7.2.13/xampp-linux-x64-7.2.13-0-installer.run?from_af=true
Resolving downloadsapachefriends.global.ssl.fastly.net (downloadsapachefriends.global.ssl.fastly.net)... 151.101.109.194
Connecting to downloadsapachefriends.global.ssl.fastly.net (downloadsapachefriends.global.ssl.fastly.net)|151.101.109.194|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 139048540 (133M) [binary/octet-stream]
Saving to: ‘xampp-linux-x64-7.2.13-0-installer.run’
xampp-linux-x64-7.2.13-0-installer.run 100%[=====================================================================================>] 132.61M 41.4KB/s in 48m 53s
2018-12-15 23:25:33 (46.3 KB/s) - ‘xampp-linux-x64-7.2.13-0-installer.run’ saved [139048540/139048540]
root@huawei2:/home/yu#
root@huawei2:/home/yu#
root@huawei2:/home/yu# ll
total 135804
drwxr-xr-x 2 root root 4096 Dec 15 22:36 ./
drwxr-xr-x 7 root root 4096 Dec 15 21:59 ../
-rw-r--r-- 1 root root 139048540 Dec 13 23:04 xampp-linux-x64-7.2.13-0-installer.run
root@huawei2:/home/yu# chmod +x xampp-linux-x64-7.2.13-0-installer.run
root@huawei2:/home/yu# ll
total 135804
drwxr-xr-x 2 root root 4096 Dec 15 22:36 ./
drwxr-xr-x 7 root root 4096 Dec 15 21:59 ../
-rwxr-xr-x 1 root root 139048540 Dec 13 23:04 xampp-linux-x64-7.2.13-0-installer.run*
root@huawei2:/home/yu# ./xampp-linux-x64-7.2.13-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@huawei2:/home/yu# /opt/lampp/lampp start
Starting XAMPP for Linux 7.2.13-0...
XAMPP: Starting Apache...already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
root@huawei2:/home/yu# /opt/lampp/lampp security
XAMPP: Quick security check...
XAMPP: MySQL is accessable via network.
XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes]
XAMPP: Turned off.
XAMPP: Stopping MySQL...ok.
XAMPP: Starting MySQL...ok.
XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL pma password.
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root passwort set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: Write the password somewhere down to make sure you won't forget it!!!
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
XAMPP: The FTP password for user 'daemon' is still set to 'xampp'.
XAMPP: Do you want to change the password? [yes] no
XAMPP: Done.
root@huawei2:/home/yu#