Log php errors in ubuntu

Posted by resting on Ask Ubuntu See other posts from Ask Ubuntu or by resting
Published on 2012-10-22T03:43:46Z Indexed on 2012/10/22 5:16 UTC
Read the original article Hit count: 444

Filed under:
|

I followed the setup here: Where is the PHP error log

When I look into /var/log/php_errors.log, I could see some PHP errors.

PHP Warning:  file_get_contents(/var/www/...): failed to open stream: No such file or directory in ...

But what I'm trying to see is the error when I removed a semicolon from a statement. That error above has no relation to file from where I removed the semicolon so we can just ignore that.

When I access the page with the removed semicolon, I get

The website encountered an error while retrieving https://myapp/download/decode/testfile. It may be down for maintenance or configured incorrectly.

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

But no logs in /var/log/php_errors.log.
How do I see the error that usually says which line and which file the process failed?

The real reason for trying to see the error is because I have a very huge loop, that throws the HTTP 500 error and I can't see the exact error. I'm just simulation with a removed semicolon to test things out.

Other settings:
error_reporting = E_ALL & ~E_DEPRECATED
display_errors = On

On Ubuntu 10.04.4 LTS

Update
Ok, I managed to get the error message to display.

Parse error: syntax error, unexpected T_IF in ...

However, it's still not logged. It wasn't displaying previously because Cakephp's debug level was at 0. Setting it to 2 displays the message, but no logs.

© Ask Ubuntu or respective owner

Related posts about php

Related posts about log