Warning: strftime() [function.strftime] Problem

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
tbathgate
New Member
New Member
Posts: 5
Joined: Sun Jan 18, 2009 8:14 pm

Warning: strftime() [function.strftime] Problem

Post by tbathgate »

Dear All,

Tonight I noticed that a clients CMS MS site is throwing errors:

Warning: strftime() [function.strftime]: 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 'Europe/London' for 'BST/1.0/DST' instead in /home/x/public_html/lib/smarty/Smarty_Compiler.class.php on line 400

Warning: strftime() [function.strftime]: 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 'Europe/London' for 'BST/1.0/DST' instead in /home/x/public_html/lib/smarty/Smarty_Compiler.class.php on line 400

Warning: strftime() [function.strftime]: 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 'Europe/London' for 'BST/1.0/DST' instead in /home/x/public_html/lib/smarty/internals/core.write_compiled_include.php on line 28

Warning: strftime() [function.strftime]: 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 'Europe/London' for 'BST/1.0/DST' instead in /home/x/public_html/lib/smarty/internals/core.write_compiled_include.php on line 28


Warning: Smarty_CMS::content_get_timestamp() [smarty-cms.content-get-timestamp]: 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 'Europe/London' for 'BST/1.0/DST' instead in /home/x/public_html/lib/content.functions.php on line 824

Fatal error: Call to undefined method Content::GetModifiedDate() in /home/x/public_html/lib/content.functions.php on line 824

I've checked the php.ini that is loaded on the server and it is correctly listed date.timezone = "Europe.London"

I have tried adding date_default_timezone_set('Europe/London'); to the config.php but that then says the the GetModifiedDate function can't be found.

The site was upgraded tonight to 1.9.4.2 and when I did the upgrade E_DEPRECATED is enabled was thrown as a warning

however in the php.ini i have
error_reporting = E_All & ~E_DEPRECATED

It's very odd and I can't find anything in the forums that helps.

My setup from system info is:

CMS Version
1.9.4.2

Installed Modules
CMSMailer
2.0.1
FileManager
1.1.0
ModuleManager
1.4.2
News
2.11.3
nuSOAP
1.0.2
Printing
1.1.2
Search
1.6.10
ThemeManager
1.1.4
TinyMCE
2.8.4
FormBuilder
0.7

Config Information
php_memory_limit:

process_whole_template:
false
output_compression:
true
max_upload_size:
2000000
default_upload_permission:
664
url_rewriting:
mod_rewrite
page_extension:

query_var:
page
image_manipulation_prog:
GD
auto_alias_content:
true
locale:
Europe/London
default_encoding:
utf-8
admin_encoding:
utf-8
set_names:
false
debug:
true
root_url:
http://www.x.com
ssl_url:
https://www.x.com
root_path:
/home/x/public_html (0750)
previews_path:
/home/x/public_html/tmp/cache (0755)
uploads_path:
/home/eileennu/public_html/uploads (0755)
uploads_url:
http://www.x.com/uploads
image_uploads_path:
/home/x/public_html/uploads/images (0755)
image_uploads_url:
http://www.x.com/uploads/images
ssl_uploads_url:
https://www.x.com/uploads
use_smarty_php_tags:
false

Current PHP Version (phpversion):
5.3.6
md5 function (md5_function):
On (True)
GD version (gd_version):
2
tempnam function (tempnam_function):
On (True)
Magic quotes in runtime (magic_quotes_runtime):
Off (False)
Is E_STRICT disabled in error_reporting (E_STRICT):

Is E_DEPRECATED disabled in error_reporting (E_DEPRECATED):

E_DEPRECATED is enabled
PHP Effective Memory Limit (memory_limit):
128M
Maximum Execution Time (max_execution_time):
30
PHP output_buffering (output_buffering):
On
PHP Safe Mode (safe_mode):
Off (False)
File uploads (file_uploads):
On (True)
Maximum Post Size (post_max_size):
8M
Maximum Upload Size (upload_max_filesize):
50M
Session Save Path (session_save_path):
/tmp (1777)
Sessions are allowed to use Cookies (session_use_cookies):
On (True)
Basic XML (expat) support (xml_function):
On (True)
Checking if the httpd process can create a file inside of a directory it created (create_dir_and_file):

PHP register_globals (register_globals):
Off (False)
disable_functions in PHP (disable_functions):
show_source, system, shell_exec, passthru, exec, popen, proc_open, allow_url_fopen
PHP Open Basedir (open_basedir):

Test for remote URL (test_remote_url):

fsockopen: Connection ok!
fopen: Connection ok!
Test ini_set (check_ini_set):
On (True)


Server API (server_api):
cgi-fcgi
Server Database (server_db_type):
MySQL (mysql)
Server Database Version (server_db_version):
5.1.56
Server Software (server_software):
Apache
Server Operating System (server_os):
Linux 2.6.18-164.9.1.el5xen On x86_64

Permission Information
tmp:
/home/X/public_html/tmp (0755)
templates_c:
/home/X/public_html/tmp/templates_c (0755)
modules:
/home/X/public_html/modules (0755)
File Creation Mask (umask):
/home/X/public_html/tmp/cache (0755)
config_file:
0644
config.php writable. It is more safe if you change permission to read-only

With debug switched on when I logged out of admin there is this error:

Debug: (0.023766) - (usage: 4548368) - (peak: 4578944)
IMPORTANT: SetLocale failed

I'm totally stumped here as to what this is.

Can anybody help, i've had to take her site offline until it's fixed

Thanks

Tom
User avatar
myshko
Forum Members
Forum Members
Posts: 102
Joined: Wed Feb 07, 2007 2:36 pm

Re: Warning: strftime() [function.strftime] Problem

Post by myshko »

Hi Tom,

If you added the [Date] date.timezone to your php.ini that should work.

You could maybe check with your server admin? It's possible only certain aspects of your php.ini will work.

Alternatively, this might work in your .htaccess:

Code: Select all

php_value date.timezone "Europe/London"
/m
tbathgate
New Member
New Member
Posts: 5
Joined: Sun Jan 18, 2009 8:14 pm

Re: Warning: strftime() [function.strftime] Problem

Post by tbathgate »

Hey there,

It's very weird error.

I tried the htaccess tweak and it creates a 500 error on the site.

I just don't understand why it's only this cms ms website being affected by this.

There are 19 other websites that are running on the server using wordpress, vbulletin and magento and none of them are effected by this problem.

I just don't know what else to try

Thanks

Tom
tbathgate
New Member
New Member
Posts: 5
Joined: Sun Jan 18, 2009 8:14 pm

Re: Warning: strftime() [function.strftime] Problem

Post by tbathgate »

Ok further updates.

The timezone problem was actually being caused by a rogue # in the php.ini

However now a new problem is now showing:

Fatal error: Call to undefined method Content::GetModifiedDate() in /home/x/public_html/lib/content.functions.php on line 824

I have no idea what this means now!

Any thoughts are greatly appreciated!!!!

Tom
User avatar
myshko
Forum Members
Forum Members
Posts: 102
Joined: Wed Feb 07, 2007 2:36 pm

Re: Warning: strftime() [function.strftime] Problem

Post by myshko »

Hi Tom,

I think this is a problem with your server to do with 'SetLocale()'

In your initial report, debug output: 'SetLocale failed'

Have you spoke to your hosting provider about it?

Perhaps try setting a different locale, it may be the one you are trying to use is not installed on your server.

Regards,

/m
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Warning: strftime() [function.strftime] Problem

Post by calguy1000 »

Tip of the day: Locale != Time Zone.

England/London is not a locale.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
tbathgate
New Member
New Member
Posts: 5
Joined: Sun Jan 18, 2009 8:14 pm

[SOLVED] Re: Warning: strftime() [function.strftime] Problem

Post by tbathgate »

Well this is fixed, it turns out it was a combination of two things.

A rouge # in the php.ini file

and one of the files was corrupted, a checksum showed the offending file which I replaced and all is fine now!

Thank fully!

Europe/London is a valid timezone:

http://www.php.net/manual/en/timezones.europe.php

Cheers

T
User avatar
myshko
Forum Members
Forum Members
Posts: 102
Joined: Wed Feb 07, 2007 2:36 pm

Re: Warning: strftime() [function.strftime] Problem

Post by myshko »

That's great you got it fixed, nice one.

Ignore my slip with the zone, too much coffee, too little sleep...

;)
grifs71
Forum Members
Forum Members
Posts: 28
Joined: Tue Apr 13, 2010 4:25 pm

Re: Warning: strftime() [function.strftime] Problem

Post by grifs71 »

myshko wrote:That's great you got it fixed, nice one.

Ignore my slip with the zone, too much coffee, too little sleep...

;)

I have the same problem what part in the php.ini did you modify?

Also, I live in the America/Chicago CST time zone how does that get coded?

Lastly, what file did you replace, I just performed a system update from a Centos5 1.6.7 to a new Scientific Linux 6.0 with 1.9.4.2 successfully but I have gazillions of the time errors you stated above.

Any other advice tips would be great.

[Thu Jul 07 16:48:54 2011] [error] [client 24.4.9x.xx] PHP Warning: strtotime(): 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/Chicago' for 'CDT/-5.0/DST' instead in /var/www/virtual/sl6serv2.com/html/lib/classes/class.content.inc.php on line 417
Locked

Return to “[locked] Installation, Setup and Upgrade”