4

How Can I show a custom view instead of the generic error attached in cases of the database going down unexpectedly?

enter image description here

0

2 Answers 2

15

In applications folder there is a folder named errors. There are all error files which comes up when an error is occurred.

When database error is occured, error_db.php file is shown in browser. You can edit it or replace that with your custom file.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

sir, there is no folder named errors in the application directory.
@ankitsuthar if you are not seeing errors folder in application/views folder it means you are using CodeIgniter version 2.x. It will be available in CI 3.x versions.
6

You should set $db_debug = FALSE; in your config database settings on your production server - you should NEVER show a raw database error message to your users, as it is a massive security risk

Comments

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.