[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;
    }
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM