1

I have this code to suppress all errors. When an error occurs a blank page appears, how can I replace this blank page with a custom page?

php_flag  log_errors on
php_value error_log  PHPerrors.log

## prevent access to PHP error log ##
<Files PHPerrors.log>
 Order allow,deny
 Deny from all
 Satisfy All
</Files>

## supress php errors ##
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off

1 Answer 1

2

You should define file for 500 error:

ErrorDocument 500 ./errors/500.html
Sign up to request clarification or add additional context in comments.

2 Comments

I work on windows using Appserv local server and I still get a blank page even after defining a 500 error page. Is there anything I need to change in the server config?
As I know php returns 500 erorr only when Fatal Erorr is happened. Otherwise it just inserts (if appropriate flag is enable) erorrs in your page code or just ignores them if they are not fatal. So in my view the only way to fix your problem is to raise 500 error manualy when php has no data to display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.