天天看點

【ThinkPHP】Fatal error: Uncaught think\exception\ErrorException: include(): Filename cannot be empty.

ThinkPHP 5.1架構報錯記錄

Fatal error: Uncaught think\exception\ErrorException: include(): Filename cannot be empty in /www/wwwroot/abc.com/framework/library/think/exception/Handle.php:184 Stack trace: #0 /www/wwwroot/abc.com/framework/library/think/exception/Handle.php(184): think\Error::appError(2, 'include(): File...', '/www/wwwroot/yc...', 184, Array) #1 /www/wwwroot/abc.com/framework/library/think/exception/Handle.php(184): include() #2 /www/wwwroot/abc.com/framework/library/think/exception/Handle.php(97): think\exception\Handle->convertExceptionToResponse(Object(think\exception\ErrorException)) #3 /www/wwwroot/abc.com/framework/library/think/Error.php(56): think\exception\Handle->render(Object(think\exception\ErrorException)) #4 /www/wwwroot/abc.com/framework/library/think/Error.php(90): think\Error::appException(Object(think\exception\ErrorException)) #5 [internal function]: think\Error::appShutdown() #6 {main} thrown in /www/wwwroot/abc.com/framework/library/think/exception/Handle.php on line 184

           

可能的情況

程式中使用了.env用作參數配置,且配置項中出現特殊字元,且沒有使用雙引号引入。如下圖:
           
【ThinkPHP】Fatal error: Uncaught think\exception\ErrorException: include(): Filename cannot be empty.

如果上面的雙引号去掉就會報上面的錯。