[PHP] Ubuntu快速安装起PHP7.4

前端之家收集整理的这篇文章主要介绍了[PHP] Ubuntu快速安装起PHP7.4前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

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

安装PHP:
apt-get install PHP7.4 PHP7.4-fpm PHP7.4-MysqL PHP7.4-gd PHP7.4-mbstring
service PHP7.4-fpm start
PHP -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;
    }
}

猜你在找的PHP相关文章