1.需要修改.user.ini 站点目录后加/

chattr -i .user.ini #去掉文件无法修改属性

修改内容为如下:

open_basedir=/mnt/wwwroot/hunter.com/:/tmp/:/proc/ #默认目录后没有"/"

2.使用LNMP1.4上需要将 /usr/localinx/conf/fastcgi.conf 里面的fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/"; 在该行行前添加 # 或直接删除。
3.修改站点伪静态,添加到日志access_log段前即可

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

整个配置文件:

server
    {
        listen 80;
        #listen [::]:80;
        server_name 域名;
        index index.html index.htm index.php default.html default.htm default.php;
        root  站点目录;
        include other.conf;
        #error_page   404   /404.html;
        include enable-php-pathinfo.conf;
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }
        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }
        location ~ /\.
        {
            deny all;
        }
        location / {
                    if (!-e $request_filename) {
                    rewrite ^/(.*)$  /index.php?s=$1 last;
                   }
                   }
        access_log  /home/wwwlogs/域名.log;
    }

4.重启整个lnmp服务框架

lnmp restart

正文到此结束

本文标题:LNMP一键环境中部署Thinkphp5.0

本文链接:https://www.hantaosec.com/199.html

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

声明:转载请注明文章来源及链接,不带链接禁止任何转载!访问任何网络安全相关文章,则视为默认接受网络安全文章免责声明 ,请认真阅读。

喜欢我的文章吗?
别忘了点赞或赞赏,让我知道创作的路上有你陪伴。