XAMPP是一个把Apache网页服务器与PHP、Perl,phpMyAdmin及MariaDB集合在一起的安装包,允许用户可以在自己的电脑上轻易的建立网页服务器。 – 百科
deepin用着感觉很轻量化,而且对新手比较友好,在这里简记一下安装php环境的过程和遇到的坑。
大部分都是像官方文档里说的一样附上链接https://wiki.deepin.org/wiki/Deepin_%E6%90%AD%E5%BB%BAphp%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83
如果不想看这个网页也可以看我的图
第一步: 当然是下载了 自己去官网或者点这个https://www.apachefriends.org
第二步: 我们需要选择XAMPP for linux。此处以xampp-linux-x64-7.3.1-0-installer.run为例进行说明。
下载到本地后,打开安装包所在文件夹(下载的文件就是.run的文件,在文件夹空白处右击鼠标选择在终端中打开。 然后在终端中执行以下命令:
sudo ./xampp-linux-x64-7.3.1-0-installer.run
运行后会出现用户界面 像win一样 默认就好了
安装完成之后, 程序会自动运行,此时需要手动点击进入manage server界面,点击启动全部选项。
第三步: 你要开启它
这里有几条命令
sudo ./opt/lampp/lampp start //启动
sudo ./opt/lampp/lampp restart // 重启
sudo ./opt/lampp/lampp stop //停止
这里要说一句,deepin安装完这个不会开机自启 每次开机后需要手动启动,当然你也可以去设置成开机自启
最后呢可能出现启动失败你可以修改一下它的端口号
或者关闭当前占用端口的程序,(这个我不推荐因为要开机后要每次关闭麻烦)
修改端口号
端口号修改的问题我参照了一个博客
点击
大概就是这样的
当然,另外一个做法是修改 apache 使用其他端口,可以参考网上的做法:
-
Open the file /opt/lampp/etc/httpd.conf
-
Search the “Listen 80” and change it to some other port (e.g. Listen 2145) (Line No. 40)
-
Open the file /opt/lampp/etc/extra/httpd-ssl.conf
-
Search the “Listen 443” and change it to some other port (e.g. Listen 16443) (Line No. 39)
-
Open the file “/opt/lampp/lampp”
-
Search for the port “testport 80” and replace it to “testport 2145”. Also change the “testport 443” to “testport 16443”. (Happens to be the Line No. 197, 214)
-
Now go and run “/opt/lampp/lampp start”. (It should work now).