深度Deepin20安装Nginx1.19+Php7.3+H5ai实践指南

原创
09/07 23:20
阅读数 259

1、清理残余的旧版本

sudo apt-get remove nginx nginx-common nginx-full php php-fpm

2、安装nginx PGP签名文件

`wget http://nginx.org/keys/nginx_signing.key

sudo apt-key add nginx_signing.key`

3、使用sudo修改source源

codename参数根据os来选择:https://nginx.org/en/linux_packages.html#distributions

由于deepin20采用debian10.*的版本,所以codename参数即为buster

sudo nano /etc/apt/sources.list.d/nginx.list

填入一下内容:

`deb http://nginx.org/packages/mainline/debian/ buster nginx

deb-src http://nginx.org/packages/mainline/debian/ buster nginx`

4、更新软件源并安装nginx和php-fpm

`sudo apt-get update

sudo apt-get install nginx php-fpm`

5、查看nginx版本号

参考路径 /etc/nginx/conf.d/default.conf

sudo nginx -v

6、修改php-fpm配置

参考路径 /etc/php/7.3/fpm/pool.d/www.conf 

`listen = 127.0.0.1:9000

listen.allowed_clients = 127.0.0.1`

7、修改nginx站点配置

`server { listen 80; server_name localhost;

location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm /_h5ai/public/index.php;
}
location ~ \.php$ {
    root           /usr/share/nginx/html;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}

}`

8、启动php-fpm和nginx

`sudo systemctl start php7.3-fpm

sudo systemctl start nginx`

9、下载H5ai

https://release.larsjung.de/h5ai/h5ai-0.29.2.zip

附注:

Ubuntu彻底删除PHP7.0

一、删除php的相关包及配置

sudo apt-get autoremove php7*

二、删除关联

sudo find /etc -name "*php*" |xargs rm -rf

三、清除dept列表

sudo apt purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`

四、检查是否卸载干净(无返回就是卸载完成)

dpkg -l | grep php7.0

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部