博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
thinkphp pathinfo nginx 无法加载模块:Index
阅读量:6983 次
发布时间:2019-06-27

本文共 1260 字,大约阅读时间需要 4 分钟。

thinkphp 报了

无法加载模块:Index

错误位置

FILE: /var/multrix/wxactivity_archive/ThinkPHP/Library/Think/Dispatcher.class.php  LINE: 177

这个错,刚开始以为是路由错了,还跟了一下代码,始终没有答案,弄了一上午,最后好好看了一下官方文档,才知道是pathinfo弄的货

config.php中设置/* URL配置 */'URL_CASE_INSENSITIVE' => true, // 默认false 表示URL区分大小写 true则表示不区分大小写'URL_MODEL' => 2, // URL模式

接下来就是nginx 设置了

server {    listen 80 default_server;    listen [::]:80 default_server ipv6only=on;    root /var/multrix/new_server_archive;    index index.html index.htm index.php;    # Make site accessible from http://localhost/    server_name 192.168.99.100;    #server_name 10.0.2.15;    location / {        index  index.php;        if (!-e $request_filename) {             rewrite  ^/(.*)$  /index.php/$1  last;            break;        }    }    location ~ .+\.php($|/) {        set $script    $uri;        set $path_info  "/";        if ($uri ~ "^(.+\.php)(/.+)") {            set $script     $1;            set $path_info  $2;         }                     fastcgi_pass unix:/var/run/php5-fpm.sock;        fastcgi_index  index.php?IF_REWRITE=1;        include fastcgi_params;        fastcgi_param PATH_INFO $path_info;        fastcgi_param SCRIPT_FILENAME  $document_root/$script;        fastcgi_param SCRIPT_NAME $script;    }}

这样问题,就解决了,瞬间世界又清静了

转载地址:http://spnpl.baihongyu.com/

你可能感兴趣的文章
SQL Server会话KILL不掉,一直处于KILLED /ROLLBACK状态情形浅析
查看>>
顺时针打印矩阵
查看>>
AUC、ROC、Recall、Precision和F1 Score
查看>>
MongoDB的数据格式及数据类型
查看>>
每天学点SpringCloud(七):路由器和过滤器-Zuul
查看>>
解决fastjson反序列化时报错的问题
查看>>
BlockingQueue学习
查看>>
博客详细配置,相信我你想要的配置都在这里
查看>>
GTK+重拾--03
查看>>
SpringBoot 手写拦截器
查看>>
为什么我们做分布式使用Redis?
查看>>
web前端知识体系大全,教你如何学习前端!
查看>>
py 决策树①
查看>>
帮您找到正确的提问渠道
查看>>
C# WinForm 按钮下拉列(SplitButton)简单使用示例
查看>>
出差第二天
查看>>
JavaScript—ES6关于Promise的用法(19)
查看>>
Google发布机器学习平台Tensorflow游乐场~带你玩神经网络(转载)
查看>>
上:Spark VS Flink – 下一代大数据计算引擎之争,谁主沉浮?
查看>>
PostgreSQL技术周刊第2期:用PostgreSQL解海盗分金问题
查看>>