欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

[视频教程] ubuntu系统下安装最新版PHP7.3.X环境

程序员文章站 2024-02-06 18:06:40
视频地址: https://www.bilibili.com/video/av69088870/ 笔记: 先安装一下这个命令 add-apt-repositoryapt-get install software-properties-common 添加第三方源:add-apt-repository ......

视频地址:

笔记:

 

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

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

安装php:
apt-get install php
apt-get install php-fpm
service php7.3-fpm start
php -v


nginx配置文件中注意的点,一旦遇到"primary script unknown",检查下面三个地方:

root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param script_filename $document_root$fastcgi_script_name;

 

server {
    listen       80;
    server_name  127.0.0.1;
    access_log  /var/log/nginx/default.access.log  main;
    error_log /var/log/nginx/default.error.log;
    root   /usr/share/nginx/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-fpm配置文件中注意的点:
listen = 127.0.0.1:9000