I had a line - $autoload['libraries'] = array('database');
, in CI's autoload.php
. Because of this I was getting a blank page. When I removed the 'database'
, option then I started getting the output.
Now my question is not how to configure the database, but how to configure CI to speak its mind. When 'database'
was enabled all I got was a complete blank page. No error in php log, no error in Apache log, no error in CI log. In PHP I have set E_ALL
. In my CI config I have set log_threshold
to 4
, i.e. all messages should be logged. What more do I need to do?
You can find the log messages in application/log/. Make sure that this directory is writable before you enable log files. Various templates for error messages can be found in application/views/errors/cli or application/views/errors/html.
The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
CodeIgniter default environment is development and so error reporting by default in turn on state, if you want to turn off reporting then change the environment value(in the top of the main index. php) to production or testing. The above method will work with only For >= 2.
$this refers to the current object. Whenever you create an instance like this: $something = new SomeClass(); Then $this refers to the instance that is created from SomeClass , in this case $something .
It depends on your version of CI. For < 2.x edit the top level index.php and adjust the error_reporting function to use E_ALL"
error_reporting(E_ALL);
For >= 2.x edit the top level index.php and make sure ENVIRONMENT is set as:
define('ENVIRONMENT', 'development');
which sets the error_reporting to E_ALL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With