Welcome Guest, Not a member yet? Register   Sign In
Timezone settings problem in codeigniter
#1

[eluser]abdel[/eluser]
I am trying to setup CodeIgniter on my WAMP with PHP 5.3.5 and 2.0.2 CI. My "Hello World" application run successfully (I had only a controller and view). Next I added a Model test.php

Code:
class Hello extends CI_Model {

    function __construct() {    
        parent::__contruct();
    }
}
I instantiate the model in my controller as:

Code:
$this->load->model('Tests');
But I keep getting this error:

Quote:A PHP Error was encountered

Severity: Warning

Message: require_once(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Dubai' for '4.0/no DST' instead

Filename: models/hello.php

Line Number: 9

How do I resolve this error? I tried setting date.timezone property in php.ini. I also tried calling date_default_timezone_set method in index.php of CI.

I did go through CI forum but everybody seems to have fixed the issue by calling date_default_timezone_set. But when I call the method, I don't even get the error. Instead, I get an 500 server error response from Apache!

I get this error only when I invoke the controller that instantiate the model. For reference, here is my controller as well:

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

class Hello extends CI_Controller {

    public function index()
    {
        $this->load->view('hello');
    }
    
    public function newfun()
    {
        
        $this->load->model('hello');
        echo 'Look at this!';
    }
}

?>

I get the issue only when i call: http://localhost/ci/index.php/hello/newfun

Please help. I am just getting started with CI.


Messages In This Thread
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 01:10 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 01:42 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 03:36 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 03:41 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 03:47 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 03:52 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 04:04 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 04:27 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 04:34 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 04:53 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 06:31 AM
Timezone settings problem in codeigniter - by El Forum - 04-18-2011, 07:24 AM
Timezone settings problem in codeigniter - by El Forum - 04-19-2011, 12:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB