Portal Home > Knowledgebase > Articles Database > PHP Default timezone resetting to GMT
PHP Default timezone resetting to GMT
Posted by MGCJerry, 12-17-2012, 10:05 PM |
I have been dealing with an issue now for awhile and it is REALLY getting on my nerves.
PHP keeps resetting back to GMT timezone though I have a different timezone set in my php.ini file. I've reinstalled php, upgraded downgraded and it still happens. Yes I know I can put it in my scrips, but I shouldn't have to my server is in the same timezone as me, and it used to work fine at one time. So does anyone else have any additional ideas?
I can restart apache, and everything goes back to normal, then it will suddenly reset back to GMT after a day or so.
Relevant info from phpinfo():
|
Posted by HelpOps, 12-17-2012, 11:07 PM |
What did you use to install php? You could have something that is resetting the timezone through a scheduled task, another application, etc.
What happens if you set the timezone and add an additional comment to the file? Is this information removed when the timezone gets reset? If so you will need to see what is changing it, this could be IIS, web platform installer, etc.
You can also try setting php up manually and not using the default php.ini directory.
Be sure to check the permissions and last access and write time for the php.ini file, if this keeps happening you can setup auditing to tell you exactly what is modifying the file and when. If you also want to know if anything else is being changed you can create a watcher on the file or do a diff when the access time changes.
|
Posted by MGCJerry, 12-17-2012, 11:31 PM |
Thanks for the reply TheHeartSmasher...
* I have installed php manually... I always do it that way and have since the early php4 days.
* Task scheduler is not running on this server, and no other applications to my knowledge are making use of "php.ini". Minimal software config. Windows Server 2003
* I haven't tried adding an additional comment or playing around with it like that, ill try that the next time I'm messing around with the server.
* The "last modified" date was 2 months ago when I last modified it. I used examdiff to compare the files side-by-side to my read-only "default" "php.ini" file, and its mostly unchanged. Even with the default "php.ini" it still does it (and breaks a few php scripts)
* I'm running Apache (I suppose I should have specified)
* I have tried using "php.ini" in different directories but the issue still remains. I only have 1 "php.ini" on the server, anywhere and its in C:\windows.
* As far as I know I'm the only one changing "php.ini" and even then there's only a couple line difference (comments while experimenting with timezones, and I have some listed in there for convenience) between it and my "default".
Thanks again for your response.
|
Posted by MGCJerry, 12-20-2012, 06:37 AM |
Update:
I have commented out the timezone setting ( date.timezone )in "php.ini", and so far it seems to be working.
|
Posted by MGCJerry, 12-22-2012, 11:09 PM |
Nope, its now set back to GMT time zone.
Going to say the hell with it and edit all my scripts to address this issue. Fun.
|
Posted by Snoork Hosting, 12-23-2012, 11:07 PM |
Try setting a permission on the PHP.ini file to prevent writing data and see if that works. That is surely not a resolution to the source of the problem, but can be a quick fix in your case.
|
Add to Favourites Print this Article
Also Read
Virpus Down (Views: 813)