Bhumi Singhal
Bhumi Singhal

Reputation: 8297

Customise the 500 Error page in php

I have my website code in codeigniter wherein I am fusing images using Imagick in php.There are a lot of functions which can generate the 500 HTTP error.I require a customised 500 error page that I create instead of the general browser 500 error page.

I have read that using the ErrorDocument 500 error_doc/500.html in .htaccess won't help as the Apache has handed of to PHP. But I also need a general solution pan-website which should automatically check for 500 and display the required custon page.

Upvotes: 1

Views: 7646

Answers (2)

user2962510
user2962510

Reputation: 35

Create a file called 500.shtml and upload it to public_html or whatever your root uploading directory is. Use the 500.shtml file to create a 500 Internal Server Error custom page.

Upvotes: 1

Jeemusu
Jeemusu

Reputation: 10533

Codeigniter actually has a custom 500 error page. If you find your getting a generic 500 error page, it could be Apache overriding the codeiginter 500 error page.

You could override it in the .htaccess to direct it to your own custom 500.html, but then you will miss out on any of the error information provided by codeiginter:

ErrorDocument 500 /errors/500.html


You could also edit the codeiginter 500 error page found in /application/errors/. I think it is the error_php.php file.

Upvotes: 1

Related Questions