Thinkphp debug为true时页面能正常打开,关闭debug后,页面错误。

设置了thinkphp的路由功能,在全局配置文件common/conf/config.php下设置了

'URL_ROUTER_ON'   => true, 
'URL_ROUTE_RULES'=>array(
    'news/:year/:month/:day' => array('Admin/Account/news', 'status=1'),
    'news/:id'               => 'Admin/Account/index',
    'blog/:year\d|md5/[:month\d]'=>'Admin/Account/index',
    '/^article\/(\d{0,4})\/(\d{0,2})$/'=>'Admin/Account/article?year=:1&month=:2',
    'closeure/:s'=>function($s){echo 'php closeure'.$s;print_r($_GET);},
    '/^rule\/(\d{0,4})\/(\d{0,2})$/'=>function ($year,$month){
        echo $year.$month;
     },
    'read/:ids'=>array('Admin/Account/index','callback=myJsonp'),
    'model'=>array('Admin/Account/model'),
 ),

在debug为true的情况下,能正常打开,访问地址是:index.php/model

但是关闭debug后,出现页面错误。

 

后面将上面一段剪切到模块目录Admin/confi/config.php里面,能正常访问了。

 应该是公共配置文件会被模块配置文件覆盖的原因。

posted @ 2015-11-18 10:30  fover的天地  阅读(2106)  评论(0)    收藏  举报