开发者

PHP handle "Failed opening ... for inclusion" error

I have a PHP script that triggers some "Failed opening ... for inclusion" fatal errors 开发者_高级运维while using an external library.

Those errors are completely irrelevant and I would like to be able to handle them (doing basically nothing about those) to avoid errors to be raised.

How can I achieve that in PHP?

Thanks,

DaN


If you absolutely want to hide the errors you can take a look at PHP's Error Control Operators. There's usually a reason for errors and/or warnings so it might be better to figure out what's causing these instead of just masking them.


You can suppress errors from individual statements by preceding it with the @ operator. For instance:

@require_once('somefile.php');

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜