首先要安装的PHP包与PHP拓展:
sudo apt-get install php7.4
php7.4-fpm php7.4-mysql
php7.4-gd php7.4-mbstring
Nginx配置文件这样写
server {
listen 80;
server_name yourdomain.com;
root /home/yourdomain/www/;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
location ~ .*\.php(\/.*)*$ {
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
access_log logs/yourdomain.log combined;
}
注意把以上配置中的yourdomain换成你自己的实际域名和实际目录存放地址
安装如下软件包
php php-fpm php-mysql php-gd php-mbstring
评论 (0)