Welcome Guest, Not a member yet? Register   Sign In
Debug PHP errors
#1

[eluser]Unknown[/eluser]
Hi!

I just started to explore the world and wonders of CodeIgniter and already found a stop:

How do I track errors/typos in my PHP code in either my controllers or views?

Consider this simple controller:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {
       public function index()
        {
this_is_nonsense,no code
                $this->load->view('welcome_message');
        }
}
?>

Look at the "this_is_nonsense,no code". It should lead to an error. What I receive is just an empty web page.
In my index.php, i did set
Code:
define('ENVIRONMENT', 'development');

I config.php, i did set
Code:
$config['log_threshold'] = 4;

The log file under "logs" doesn't reveal anything helpful, just logs initializing of classes.

The same applies to errors and typos in views or templates.

What I'm doing wrong?





#2

[eluser]bgreene[/eluser]
http://stackoverflow.com/questions/95874...r-messages
#3

[eluser]Unknown[/eluser]
Perfect answer: It turned out that I had to add
Code:
ini_set('display_errors', 1);

to my index.php as suggested by the post in the link.

Thanks, answered.

Bishop




Theme © iAndrew 2016 - Forum software by © MyBB