由于到目前为止,没有一种解决方案对您有用,请尝试以下一种方法:
ini_set('display_errors', 1);这明确地告诉PHP 显示 错误。某些环境可以默认禁用此功能。
这是我的环境设置的样子
index.php:
define('ENVIRONMENT', 'development');if (defined('ENVIRONMENT')){ switch (ENVIRONMENT) { case 'development': // Report all errors error_reporting(E_ALL); // Display errors in output ini_set('display_errors', 1); break; case 'testing': case 'production': // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); // Don't display errors (they can still be logged) ini_set('display_errors', 0); break; default: exit('The application environment is not set correctly.'); }}


