libapache2-mod-php5 forgets timezone definition after some time

Bug #907816 reported by Arie Skliarouk on 2011-12-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Medium
Unassigned

Bug Description

Under libapache2-mod-php5 5.3.2-1ubuntu4.10 (as provided by Lucid LTS release) php scripts tend to forget timezone after some time.

The timezone is correctly set in the /etc/php5/conf.d/timezone.ini file:
[Date]
date.timezone=UTC

It works properly for several hours after restart of apache. At some point the libapache2-mod-php5 forgets the definition and starts thinking that it's timezone is "America/Chicago".

The problem does not occur if php is run using CLI. Also the problem occurs only on one of my servers. It is not reproducible on other similar servers.

See attached php script for demonstration of the problem. To see the problem, upload the php script to some server and start polling it as follows:
while [ 1 ]; do wget -O - --quiet http://badmachine.yourcompany.com/print_timezone.php; sleep 10; echo -n "."; done
Once you see "+" in the output, this means the problem exists.

Arie Skliarouk (skliarie) wrote :
Robie Basak (racb) on 2011-12-23
Changed in apache2 (Ubuntu):
importance: Undecided → Medium
Arie Skliarouk (skliarie) wrote :

I am sorry, the problem was on my side. We have both python-django and php sites running on the same server. The django-based site was misconfigured to reset server's timezone to "America/Chicago". Apparently if the timezone is specified programmatically by a php or python script, it is automatically visible to all the other scripts (which IMHO is wrong).

Thus, a random visit to the timzeone-insensitive django-based site would automatically reset the server's timezone and thus break the php site (which *is* sensitive to the timezone value).

Close the bug please.

Chuck Short (zulcss) wrote :

Closing

Changed in apache2 (Ubuntu):
status: New → Invalid
Zee Alexander (pizzaops) wrote :

@Arie how were you able to resolve this issue? I think I'm experiencing it also.

nagendra rao (nagendra-d) wrote :

using timezone Asia/Kolkatta or Asia/Culcutta returns time which is incorrect.
<?php
 $timezone = "Asia/Kolkata";
 date_default_timezone_set($timezone);
 echo date('d-m-Y H:i:s');
?>

Changed in apache2 (Ubuntu):
status: Invalid → Confirmed

canonical redirections issue
https://techliveupdates.com/
www.google.com/url?q=https://techliveupdates.com/
www.google.ac/url?q=https://techliveupdates.com/
www.google.ad/url?q=https://techliveupdates.com/
www.google.ae/url?q=https://techliveupdates.com/
www.google.com.af/url?q=https://techliveupdates.com/

@nagendra-d, it does not look like this is a software bug, but a
configuration issue that @skliarie has faced. Feel free to
talk to him through this bug (for documenting purposes) but
I'm keeping the status here as Invalid so we can better track
things we actually have an action for.

Thank you for taking the time to file a bug report.

Since it seems likely to me that this is a local configuration problem,
rather than a bug in Ubuntu, I am marking this bug as 'Incomplete'.

However, if you believe that this is really a bug in Ubuntu, then we would
be grateful if you would provide a more complete description of the problem
with steps to reproduce, explain why you believe this is a bug in Ubuntu
rather than a problem specific to your system, and then change the bug
status back to "New".

For local configuration issues, you can find assistance here:
http://www.ubuntu.com/support/community

Changed in apache2 (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers