开发者

Capture error message from compiled PHP file

开发者 https://www.devze.com 2023-02-01 21:19 出处:网络
I\'m using top2ec to compile a PHP script and making an executable file of it, so I can distribute th开发者_高级运维e file. Since this application will only run a few times to capture some data, I\'ve

I'm using top2ec to compile a PHP script and making an executable file of it, so I can distribute th开发者_高级运维e file. Since this application will only run a few times to capture some data, I've used PHP enabling me to create an application without learning a new language.

Everything works fine, but the application runs on the commandline and this gets closed everytime it run in an error. To be able to debug I need to capture the error information. Does anyone know a way to get this information?

I've been looking at STDERR, but I can't really understand how it would work within the application as I don't call any other software.

So the question is basically: How to capture error messages from my top2ec compiled commandline script?

All tips are much appreciated! Thanks in advance.


Use set_error_handler to define your own error handling function. You can use it to (for example) write any error messages to a text file.

0

精彩评论

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

关注公众号