Timezone settings problem in codeigniter |
[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 { Code: $this->load->model('Tests'); Quote:A PHP Error was encountered 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'); I get the issue only when i call: http://localhost/ci/index.php/hello/newfun Please help. I am just getting started with CI.
[eluser]toopay[/eluser]
[quote author="abdel" date="1303128619"]...I tried setting date.timezone property in php.ini. [/quote] Make sure you change it properly Code: ; Defines the default timezone used by the date functions
[eluser]abdel[/eluser]
Quote:; Defines the default timezone used by the date functions I tried this. With quotes and without quotes. It makes no difference! Is this some issue with my installation? The install instructions seems very straight forward. I just extracted the download zip file and moved to the web root and renamed the folder to "ci" for easy access!
[eluser]toopay[/eluser]
Are you restarted your WAMPP service after changes that value? No, instalation process seems not an issue here. Its PHP issue actually, not related with CI or CI Instalation.
[eluser]abdel[/eluser]
Yes.. I restarted the Apache server. Currently by php.ini have: Code: [Date] and in my config.php found at ci/application/config folder has: Code: $config['time_reference'] = 'local'; When I call a controller method which doesn't reference any model.. it simply works fine! If I create a instance of the model.. it stops working! I have nothing except this in my hello.php (Model) Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]toopay[/eluser]
Abdel, remove the closing tags '?>' both in controller or model
[eluser]abdel[/eluser]
![]()
[eluser]WanWizard[/eluser]
Are you sure you've modified the correct php.ini? If you do a Code: phpinfo();
[eluser]abdel[/eluser]
I have only on installation of php.ini at C:\PF\PHP. I tried the phpinfo() and get correct value. ie Asia/Dubai! Here is what I get in data section of the page: date date/time support enabled "Olson" Timezone Database Version 2010.15 Timezone Database internal Default timezone Asia/Dubai Directive Local Value Master Value date.default_latitude 31.7667 31.7667 date.default_longitude 35.2333 35.2333 date.sunrise_zenith 90.583333 90.583333 date.sunset_zenith 90.583333 90.583333 date.timezone Asia/Dubai Asia/Dubai
|
Welcome Guest, Not a member yet? Register Sign In |