美文网首页
lnmp1.5下nginx适配thinkphp5.1.25

lnmp1.5下nginx适配thinkphp5.1.25

作者: dongshixiao | 来源:发表于2018-09-30 14:27 被阅读0次

听说tp5.1.18版本后支持了swoole,尝试了下发现nginx出错
修改php.ini 让其显示报错信息
发现是 引入上一层文件没有权限导致的错误
主要是修改

fastcgi_param PHP_ADMIN_VALUE "open_basedir=/storage/wwwroot/xxxx.com/public/:/tmp/:/proc/";
改为:
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/storage/wwwroot/xxxx.com/:/tmp/:/proc/";
server
    {
        listen 80;
        listen [::]:80;
        server_name xxxx.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /storage/wwwroot/xxxx.com/public;

        include rewrite/none.conf;
        #error_page   404   /404.html;


        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        #include enable-php-pathinfo.conf;

    location ~ [^/]\.php(/|$)
        {
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            include pathinfo.conf;
        fastcgi_param PHP_ADMIN_VALUE "open_basedir=/storage/wwwroot/xxxx.com/:/tmp/:/proc/";
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

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

        location ~ /.well-known {
            allow all;
        }

        location ~ /\.
        {
            deny all;
        }

        access_log  /home/wwwlogs/tpswoole.log;
    }

相关文章

网友评论

      本文标题:lnmp1.5下nginx适配thinkphp5.1.25

      本文链接:https://www.haomeiwen.com/subject/frjwoftx.html