先安装一下这个命令 add-apt-repositoryapt-get install software-properties-common

添加第三方源:add-apt-repository ppa:ondrej/phpapt-get update

安装php:apt-get install php7.4 php7.4-fpm php7.4-mysql php7.4-gd php7.4-mbstringservice php7.4-fpm startphp -v

nginx的配置文件和原来一样

server {

listen 80;

server_name localhost;

access_log /var/log/nginx/default.access.log main;

error_log /var/log/nginx/default.error.log;

root /var/www/html;

location / {

index index.html index.htm;

}

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

精彩内容

评论可见,请评论后查看内容,谢谢!!!评论后请刷新页面。