1、php.ini 设置 display_errors = On error_reporting = E_ALL | E_STRICT 2、ci index.php 设置 define(‘ENVIRONMENT’, ‘development’); error_reporting(E_ALL); 3、config/database.php中修改数据库设置: $db['default']['db_debug'] = TRUE;