您好,欢迎访问一九零五行业门户网

关闭APP_DEBUGE url变小写 解决方案

关闭app_debuge url变小写 解决方案
今天使用tp上线一个项目,把define('app_debug',true); 设置为false的时候,所有的页面都找不到了。提示404错误,后来发现生成的url地址:/index.php/index/article.html 怎么控制器index变成小写了,于是又把define('app_debug',false);改成了define('app_debug',true); 又一切正常了。后来发现是 thinkphp\common\functions.php 这里的u方法出了问题,
于是找到: // url组装
    $depr       =   c('url_pathinfo_depr');
    $urlcase    =   c('url_case_insensitive');是 c('url_case_insensitive'); 没有定义,则$urlcase 取值为false
于是下面的代码: if($urlcase){
       $url    =   strtolower($url);
 }strtolower 这个方法就执行了,于是得到url地址为小写,在linux区分大小写就找不到页面了,就404错误了
解决方法:
打开home\common\conf\config.php 'session_auto_start'=>true,
//加上这句话即可
 'url_case_insensitive'=>false, //设置debug在关闭的时候,生成的url变成小写的问题
//多语言定义
'lang_switch_on' => true,   // 开启语言包功能如果还是不行,则需要删除
runtime/common~runtime.php 这个文件,重新刷新即可。
如果还是不能解决,欢迎加qq:574482856
ad:真正免费,域名+虚机+企业邮箱=0元
其它类似信息

推荐信息