I'm using Codeigniter 3 in production mode but errors are displayed. My web server is Wampserver 3.1.7 with it's default php.ini. How can I disable error reporting?
This is part of my index.php:
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production');
switch (ENVIRONMENT)
{
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;
case 'testing':
case 'production':
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break;
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR
}
And this is a part of the error I have:
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>An uncaught Exception was encountered</h4>
<p>Type: Error</p>
<p>Message: Call to a member function result() on bool</p>
<p>Filename: D:\Projects\Nafis Global System\Server\application\core\MY_Model.php</p>
<p>Line Number: 377</p>
<p>Backtrace:</p>
UPDATE:
Just some of errors are displayed. for example if the Mysqli connection did not established, this error is displayed:
Message: Call to a member function real_escape_string() on bool