首页 > Web开发 > 详细

lnmp 环境,再单独安装php7.2 的版本,多版本php 同时运行

时间:2021-01-25 16:09:33      阅读:36      评论:0      收藏:0      [点我收藏+]

安装php7.2

 lnmp 环境单独再配置php新版本:
 sudo ./install.sh mphp   ----- 我本次的环境,原有是用lnmp1.3 安装的
 可以直接下载lnmp1.5的包,从里面单独安装php7.2,安装的过程中,原有的lnmp环境会被破坏掉;
 默认没有安装redis,从lnmp1.5 的 ./addons.sh 安装redis,安装的时候会提示所选择的php版本,
 安装好了会自动重启php-fpm

nginx 配置

server{
        listen 80;
        server_name local.txsq.com;
        index index.html index.htm admin.php index.php;
        root  /home/wwwroot/default/txsq/tortoise/Public;

        #error_page   404   /404.html;
        include enable-php7.2-pathinfo.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   off;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

  	if (!-e $request_filename) {
#         	rewrite ^/(.*)  /index.php/$1 last;
  	}

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/access-txsq.log;
}

enable-php7.2-pathinfo.conf 文件配置展示

        location ~ [^/]\.php(/|$)
        {
        #   try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi7.2.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
	    include pathinfo.conf;		
        }

lnmp 环境,再单独安装php7.2 的版本,多版本php 同时运行

原文:https://www.cnblogs.com/pansidong/p/14324901.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!