How to disable PHP Error reporting in CodeIgniter?

Viewed 119719

I've read the official documentation and all they say is that I should have a error_reporting() function located at the top of your main index.php file. But I don't have index.php file in my project. My base controller is called core so to get to main index I go to www.mysite.dom/core/. So I guess this error reporting function should be inside this controller? Then what I would like to know is where should I put it in the controller and what to put inside of it to disable the reporting. Thank you all for help, guess I am missing something :/

4 Answers

No need to type a long query to disable error reporting in codeigniter. Use error_reporting(0); in the page to disable displaying errors in that page.

<?php
  error_reporting(0);
?>

i know i am very late but you can just do this : Find below code in index.php file

define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');

and replace development with production

Related