Ubuntu下安装Xampp(亲自安装)

为了省去很多不必要的权限转换,我们首先把Ubuntu开通root管理员帐号。

如何开通管理员root帐号?参见文章:如何启用Ubuntu 18超级管理员账户root?

一、命令行安装(非可视化界面)

更改安装程序的权限

chmod 755 xampp-linux-*-installer.run

运行安装程序

sudo ./xampp-linux-*-installer.run

就这样。XAMPP 现在安装在 /opt/lampp 目录下。

Ubuntu下安装Xampp
Ubuntu下安装Xampp
root@nextcloud:/opt# chmod 755 xampp-linux-x64-7.3.31-2-installer.run
root@nextcloud:/opt# sudo ./xampp-linux-x64-7.3.31-2-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.

二、可视化界面安装

第一步:官方网站下载Xampp,Xampp官方下载地址

第二步:将下载好的安装包,即xampp-linux-x64-7.3.10-0-installer.run文件拷贝到opt文件夹。

备注:由于我已经安装成功xampp,安装成功后ubuntu会自动删除安转包,所以你现在看到的截图并没有安装包xampp-linux-x64-7.3.10-0-installer.run文件。

*第三步:在opt文件夹下右击,打开终端窗口。

备注:如果你没有通过在opt文件夹下右击打开终端,那么你需要切换到opt文件夹下才能安装,但是很多新手并不知道如何在终端下切换到当前opt文件夹!所以强烈建议在opt文件夹下右击打开终端,终端默认在当前文件夹下。

opt文件夹下右击打开终端
opt文件夹下右击打开终端

第四步:在终端窗口,输入以下命令:sudo ./xampp-linux-x64-7.3.10-0-installer.run

回车后,开始安装。因为我的Ubuntu是可视化界面,他会跳出可视化界面让你下一步,如果你没有可视化界面,在命令行一直往下就可以!

省去部分安装截图…

第五步:在浏览器检查是否安装成功,输入:localhost,回车!如果出现下图,恭喜您已经安装成功Xampp!!!!

写在后

1、如果您使用的ubuntu桌面版本(即可视化界面),想调出可视化界面开启、关闭、重启mysql或者aparche,请使用命令:sudo /opt/lampp/./manager-linux-x64.run

2、基本命令汇总:

启动xampp:sudo /opt/lampp/lampp start

关闭xampp:sudo /opt/lampp/lampp stop

3、Xampp默认安装好后,mysql默认没有密码、FTP默认的登录名和密码分别是:daemon;xampp;如何设置设置增加安全性?

使用命令行:sudo /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] yes
      XAMPP: Turned off.
      XAMPP: Stopping MySQL...
      XAMPP: Starting MySQL...
      XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
      XAMPP: Do you want to set a password? [yes] 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] yes
      XAMPP: Write the passworde somewhere down to make sure you won't forget it!!!
      XAMPP: Password: ******
      XAMPP: Password (again): ******
      XAMPP: Setting new MySQL root password.
      XAMPP: Setting phpMyAdmin's root password to the new one.
      XAMPP: The FTP password for user 'nobody' is still set to 'lampp'.
      XAMPP: Do you want to change the password? [yes] yes
      XAMPP: Password: ******
      XAMPP: Password (again): ******
      XAMPP: Reload ProFTPD...
      XAMPP: Done.

当您安装好xampp后,您也可以参考文档:http://localhost/dashboard/faq.html,他很大程度上会帮助您使用xampp!!!

滚动至顶部