errors showing when they should be off

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
philmills
User
Posts: 555

errors showing when they should be off

Post by philmills »

I have debugging turned off on my production server.
But PHP errors are being displayed such as:
/var/www/html/models/MyPage.php(3839): syntax error, unexpected token "public"

I made this error deliberately to test if error display generally, so I don't need help with this specific error.
I need to figure out why the Error 500 page isn't being displayed instead

in php.ini i have display_errors off and I checked this with phpinfo
in production config I have:
"DEBUG" => false, // Enabled
"REPORT_ALL_ERRORS" => true, // Treat PHP warnings and notices as errors
"LOG_ERROR_TO_FILE" => true, // Log error to file
"LOG_ERROR_DETAILS" => true, // Log error details

I don't want users to see any error details, I can get those from log files or turn on debug temporarily when needed.
Any ideas what else to check?


arbei
User
Posts: 9384

Post by arbei »

Note that syntax error cannot be caught.


mobhar
User
Posts: 11726

Post by mobhar »

In addition, you should make sure your script has already free from syntax error before uploading to production server.


philmills
User
Posts: 555

Post by philmills »

mobhar wrote:

In addition, you should make sure your script has already free from syntax error before uploading to production server.

That's true, but not the point.
If there is an error, which happens sometimes i just want an error 500, i don't want people to see any details about the error.
That's what i was testing.


Post Reply