目录

thinkphp5.1-在fetch模版就超时

thinkphp5.1 在fetch模版就超时

场景

当被渲染模版不存在,请求不响应任何内容,过一会就timeout

https://i-blog.csdnimg.cn/direct/5ed2d2f1cb344cc18b822bf21966dd92.png

https://i-blog.csdnimg.cn/direct/d55eaa4856f54f6aa65c5a50eacd2b8b.png

排查过程

使用xdebug,追踪代码,发现走到D:\temporary_files\m40285_mini\40285_mini\thinkphp\library\think\exception\Handle.php,进入死循环,一直跳不出while循环,导致超时,并有错误信息

https://i-blog.csdnimg.cn/direct/64977d9e4ba24f70bbefd768b8a41458.png

https://i-blog.csdnimg.cn/direct/3b4390915983462189e803f9b417b519.png

解决

将禁用函数去掉,即可抛出异常

https://i-blog.csdnimg.cn/direct/d81975ab11484915a841c6152db6a1ea.png

https://i-blog.csdnimg.cn/direct/98bcaefcca86481a952541696c93a4ee.png