Min*_*ure 1 php try-catch require include
我将如何检查是否包含或要求中包含错误.例如,并尝试包含include,如果该页面有错误,则不包含页面并抛出消息?
干杯.
Mar*_*man 5
您无法在相同语言环境中捕获PHP中的解析错误(出于显而易见的原因).
一种方法可能是php -l your_included_file.php使用exec运行,然后检查退出代码.该-l(皮棉)的说法检查你的代码可以被正确解析.
php -l your_included_file.php
-l
归档时间:
16 年 前
查看次数:
1664 次
最近记录:
15 年,4 月 前