成都创新互联网站制作重庆分公司

ubuntunginxphp7.1

sudo apt-get update 

创新互联公司主要从事成都网站建设、做网站、网页设计、企业做网站、公司建网站等业务。立足成都服务新蔡,10年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:028-86922220

sudo apt-get install -y language-pack-en-base

locale-gen en_US.UTF-8

sudo apt-get install software-properties-common 

sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php

sudo apt-get update 

sudo apt-get -y install php7.1

sudo apt-get -y install php7.1-MySQL

sudo apt-get install php7.1-fpm

apt-get install php7.1-curl php7.1-xml php7.1-mcrypt php7.1-json php7.1-gd php7.1-mbstring

sudo apt-get -y install nginx

sudo apt-get -y install mysql-server-5.6

原文链接:https://www.cnblogs.com/php-linux/p/6016439.html

nginx 配置文件:

server {

       listen 80;

       listen [::]:80;

       server_name abc.cn;

       root /var/www/abc_cn;

       index index.html index.php;

location / {

         try_files $uri $uri/ /index.php?$query_string;

       }

        location ~ \.php$ {

            include snippets/fastcgi-php.conf;

            fastcgi_pass unix:/run/php/php7.1-fpm.sock;

        }

}

因为复制之前的配置文件,使用的是fastcgi_pass unix:/run/php/php7.0-fpm.sock;,导致出现502错误,和访问php文件直接下载了,把7.0换成7.1后,就解决了。

如果出现500错误,就是权限问题

chmod -R 777 .


文章题目:ubuntunginxphp7.1
URL标题:http://cxhlcq.com/article/ijdpod.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部