Welcome Guest, Not a member yet? Register   Sign In
How can I display normal php errors?
#1

[eluser]0plus1[/eluser]
I'm seldomly getting this error:


Quote:A Database Error Occurred

Unable to select the specified database: xxx

The database works and using the "normal" php functions works too.. I would love to know what php is telling code igniter.

How can I do this?
#2

[eluser]Zeeshan Rasool[/eluser]
You may enable error reporting from index.php on root by setting:
error_reporting(E_ALL);
#3

[eluser]0plus1[/eluser]
[quote author="zEsHaN" date="1258056557"]You may enable error reporting from index.php on root by setting:
error_reporting(E_ALL);[/quote]

This continues to show the:

Code:
A Database Error Occurred

Unable to select the specified database: xxx

instead of the "real" php error
#4

[eluser]AgentPhoenix[/eluser]
What you're seeing isn't a PHP error, it's an error being returned from your database. You can tell because the top of it says a database error occurred. CI has a completely separate error view for errors returned from the database. If it's a PHP error, the message would say "A PHP Error was encountered."
#5

[eluser]Vi.[/eluser]
Just open your apache log file and go to last line. You can also use CI log file to save PHP errors into log file. Open application/config.php and change $config['log_threshold'] to '4'. All errors will save into system/logs/ folder.

CI has custom error page for some part. Database, mysql query, unaccessible uri etc.
#6

[eluser]Unknown[/eluser]
Hi from Argentina.

To show all php errors, i just update de index.php like this:


if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
ini_set('display_errors','On'); // <----- added
break;

case 'testing':
case 'production':
error_reporting(0);
ini_set('display_errors','Off'); // <----- added
break;

default:
exit('The application environment is not set correctly.');
}
}




Theme © iAndrew 2016 - Forum software by © MyBB