Welcome Guest, Not a member yet? Register   Sign In
HTTP error codes for php syntax and sql errors
#11

[eluser]ricick[/eluser]
No I really do understand that the interpreter is not even compiling my code.

This problem is mainly because I'm using CI to write a REST web service for consumption in flash.

The problem being that because I'm not viewing the output in a web browser, it's not always immediately apparent that there is a syntax error, whereas if I can get error codes this becomes easy to spot.

This is especially true if I'm making a request where I don't want to "use" the response body, such as a HTTP delete, so problems can go unnoticed easily.
#12

[eluser]Unknown[/eluser]
I came across this thread while searching everywhere for a solution to this problem. I have a simple wget script, to post files, that depends on the status code being correct, if the post request fails but the web app replies with status 200 then data will be lost. So, the solution...

You need to have php.ini configured properly, for production use, for PHP to return HTTP 500 status code on parse errors.

Code:
display_errors = Off
log_errors = On
error_log = /the/path/to/phperrors.log

You need a version of PHP >= 5.2.4




Theme © iAndrew 2016 - Forum software by © MyBB