在搭建好CI框架后访问http://localhost/ci的时候总是出现Disallowed Key Characters.
解决办法:
在项目中搜索到包含“Disallowed Key Characters”的位置,一般在ci/system/core/Input.php中,大概在731行左右有如下代码:
if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) { exit(‘Disallowed Key Characters.‘); }
把上面3行代码修改成下面的代码即可解决问题:
$config = &get_config(‘config‘); if ( ! preg_match("/^[".$config[‘permitted_uri_chars‘]."]+$/i", rawurlencode($str))) { exit(‘Disallowed Key Characters.‘); }
本文出自 “我是IT农民工” 博客,请务必保留此出处http://lfliangli.blog.51cto.com/2853536/1381704
CI框架中出现Disallowed Key Characters,布布扣,bubuko.com
CI框架中出现Disallowed Key Characters
原文:http://lfliangli.blog.51cto.com/2853536/1381704