Forums / General Questions / PHP 5.3 problem: Warning: date() [function.date]: It is not safe to rely on the syste

PHP 5.3 problem: Warning: date() [function.date]: It is not safe to rely on the syste

Locked

Started by time111 on 17 Mar 2010, 12:04 PM · Views: 101,159

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
17 Mar 2010, 12:04 PM
#1
time111 avatar

time111

New Zenner

Join Date:
Sep 2008
Posts:
95
Plugin Contributions:
0

PHP 5.3 problem: Warning: date() [function.date]: It is not safe to rely on the syste

Hi,

I have patched as given in instructions and all files needed to be patched were never modified by me. So it was a clean patch.

But after patch, site started to function normally but if i go to admin login page im getting following errors.

Somebody please help me as without admin access its not possible to run site.

~ Time
Zencart version 1.3.8a
MySQL version 5.1.41
Apache version 2.2.15
PHP version 5.3.2

==================================
Warning: date() [function.date]: 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 'America/New_York' for 'EDT/-4.0/DST' instead in /home/public_html/admin/includes/languages/english/email_extras.php on line 40

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/admin/includes/languages/english/email_extras.php:40) in /home/public_html/admin/includes/init_includes/init_templates.php on line 36

Warning: date() [function.date]: 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 'America/New_York' for 'EDT/-4.0/DST' instead in /home/public_html/includes/functions/specials.php on line 54

Warning: date() [function.date]: 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 'America/New_York' for 'EDT/-4.0/DST' instead in /home/public_html/includes/functions/specials.php on line 29

Warning: date() [function.date]: 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 'America/New_York' for 'EDT/-4.0/DST' instead in /home/public_html/includes/functions/featured.php on line 53

Warning: date() [function.date]: 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 'America/New_York' for 'EDT/-4.0/DST' instead in /home/public_html/includes/functions/featured.php on line 29

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/admin/includes/languages/english/email_extras.php:40) in /home/public_html/admin/includes/functions/general.php on line 21

17 Mar 2010, 2:29 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: PHP 5.3 problem: Warning: date() [function.date]: It is not safe to rely on the syste

This doesn't look like it's related to the patch at all, but rather it's a problem with your server's PHP configuration.> time111:

Warning: date() [function.date]: 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 'America/New_York' for 'EDT/-4.0/DST' instead ...
ie: the error message suggests that your php.ini settings have 'EDT/-4.0/DST' set as your timezone setting, which is clearly invalid, and should be more like 'America/New_York' instead.

If you're not already aware of how to edit php.ini settings for your particular site, I suggest you contact your hosting company for specific instructions as it relates to what they'll allow you to do on your site with their servers.

This is not a Zen Cart issue. It's a PHP configuration issue which is triggered when the very simple common "date()" function is called within PHP. If you fix your timezone settings in your PHP configuration, the problem should go away.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Mar 2010, 2:55 PM
#4
time111 avatar

time111

New Zenner

Join Date:
Sep 2008
Posts:
95
Plugin Contributions:
0

Re: PHP 5.3 problem: Warning: date() [function.date]: It is not safe to rely on the syste

Hi,

I forwarded request to server people for time zone issue, lets see what happens.

But what about last error issue:

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/admin/includes/languages/english/email_extras.php:40) in /home/public_html/admin/includes/functions/general.php on line 21

And one more thing is the php.ini override can be placed in admin/php.ini. As its there for suhosin.session.encrypt = off. If so then what is the code to put time edit also in that, ill try the code if you give me.

~Time

17 Mar 2010, 3:07 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: PHP 5.3 problem: Warning: date() [function.date]: It is not safe to rely on the syste

Your "headers already sent" message is a direct result of the error message preceding it. Fix the root issue and the others will go away.

As to your php.ini settings, I suggest you look for the timezone that was rejected in the error message and replace it with what it says it recommended.
or you can look it up at https://www.php.net

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Mar 2010, 5:36 PM
#6
time111 avatar

time111

New Zenner

Join Date:
Sep 2008
Posts:
95
Plugin Contributions:
0

Re: PHP 5.3 problem: Warning: date() [function.date]: It is not safe to rely on the syste

Hello,

Thank you and it looks like issue resolved.

I have added following line in admin/php.ini file

date.timezone = "America/New_York"

Here you can see more time zones http://www.php.net/manual/en/timezones.php

~Time