Warning: strtotime() [function.strtotime]: It is not safe to
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Tue Jan 20, 2009 1:20 pm
Warning: strtotime() [function.strtotime]: It is not safe to
I am a new user of Joomla, have completed installing it running on Open Solaris 2008.05.
Joomla 1.5.9 production/stable
php 5.26
I installed with no sample pages/data.
Now I want to begin administering a site.
Logged into the Front Page Manager, and the following message appears:
Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm in /opt/coolstack/apache2/htdocs/Joomla/libraries/joomla/utilities/date.php on line 56
I've looked through the Joomla site and googled, but I'm still unclear on what I need to do to eliminate this warning.
Can anybody tell me specifically, perhaps even step by step, where/how/what I need to change?
Thanks.
Joomla 1.5.9 production/stable
php 5.26
I installed with no sample pages/data.
Now I want to begin administering a site.
Logged into the Front Page Manager, and the following message appears:
Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm in /opt/coolstack/apache2/htdocs/Joomla/libraries/joomla/utilities/date.php on line 56
I've looked through the Joomla site and googled, but I'm still unclear on what I need to do to eliminate this warning.
Can anybody tell me specifically, perhaps even step by step, where/how/what I need to change?
Thanks.
- dhuelsmann
- Joomla! Master
- Posts: 19659
- Joined: Sun Oct 02, 2005 12:50 am
- Location: Omaha, NE
- Contact:
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Per this http://ezpedia.org/wiki/en/ez/php5_technical_notes, the problem is probably in the server's php.ini file:
The solution is to set date.timezone in php.ini, if the TZ environment variable isn't set:
.. where "Europe/Brussels" was used as an example.
If you aren't the administrator of this site, you may need to communicate this information to him/her. I'd expect the admin does not see this, or it would have been fixed already.
If you can't get your administrator to fix the php.ini file, and if your host allows php directives in .htaccess, you can add this command to your .htaccess in Joomla root.
where "yourServerTimeZone" is one of timezones listed here: http://php.net/manual/timezones.php
For example :
The solution is to set date.timezone in php.ini, if the TZ environment variable isn't set:
Code: Select all
[Date]
; Defines the default timezone used by the date functions
date.timezone = "Europe/Brussels"
If you aren't the administrator of this site, you may need to communicate this information to him/her. I'd expect the admin does not see this, or it would have been fixed already.
If you can't get your administrator to fix the php.ini file, and if your host allows php directives in .htaccess, you can add this command to your .htaccess in Joomla root.
Code: Select all
php_value date.timezone yourServerTimeZone
For example :
Code: Select all
php_value date.timezone Europe/Moscow
or
php_value date.timezone America/Chicago
Regards, Dave
Past Treasurer Open Source Matters, Inc.
Past Global Moderator
http://www.kiwaniswest.org
Past Treasurer Open Source Matters, Inc.
Past Global Moderator
http://www.kiwaniswest.org
-
- Joomla! Fledgling
- Posts: 2
- Joined: Tue Jan 20, 2009 1:20 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Ah, ok.. duh..
Thanks alot... fixed it
And nice to meet a Joomla master ....
I'm looking forward to seeing how well this can serve my needs.
Thanks again.
Thanks alot... fixed it
And nice to meet a Joomla master ....
I'm looking forward to seeing how well this can serve my needs.
Thanks again.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Aug 11, 2009 11:15 am
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Hi there. I have the same problem but not really sure how to change it, can you help please.
The code for me should be "Europe/London" as im in the UK.
Code:
[Date]
; Defines the default timezone used by the date functions
date.timezone = "Europe/London"
The code for me should be "Europe/London" as im in the UK.
Code:
[Date]
; Defines the default timezone used by the date functions
date.timezone = "Europe/London"
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Aug 11, 2009 11:15 am
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Well I seem to have fixed it, doing a complete uninstall then a reinstall and checked the php.ini file and it had the Code:
[Date]
; Defines the default timezone used by the date functions
date.timezone = "Europe/London"
But now I cannot see menu items and getting theses error messages:
Warning: Parameter 4 to JHTMLMenu::treerecurse() expected to be a reference, value given in C:\xampp\htdocs\Joomla15\libraries\joomla\html\html.php on line 87
Warning: array_slice() expects parameter 1 to be array, null given in C:\xampp\htdocs\Joomla15\administrator\components\com_menus\models\list.php on line 143
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Joomla15\administrator\components\com_menus\models\list.php on line 147
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Joomla15\administrator\components\com_menus\views\list\view.php on line 65
I'am working to the Joomla! 1.5 Quick Start Guide. Anyone have any ideas?
[Date]
; Defines the default timezone used by the date functions
date.timezone = "Europe/London"
But now I cannot see menu items and getting theses error messages:
Warning: Parameter 4 to JHTMLMenu::treerecurse() expected to be a reference, value given in C:\xampp\htdocs\Joomla15\libraries\joomla\html\html.php on line 87
Warning: array_slice() expects parameter 1 to be array, null given in C:\xampp\htdocs\Joomla15\administrator\components\com_menus\models\list.php on line 143
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Joomla15\administrator\components\com_menus\models\list.php on line 147
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\Joomla15\administrator\components\com_menus\views\list\view.php on line 65
I'am working to the Joomla! 1.5 Quick Start Guide. Anyone have any ideas?
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Aug 11, 2009 11:15 am
-
- Joomla! Apprentice
- Posts: 31
- Joined: Thu Jan 29, 2009 3:54 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
I've tried the patch, I've tried changing in php.ini
Neither is working. Any other solutions?
Edited to add:
When I added " " around Europe/City it worked just fine.
Neither is working. Any other solutions?
Edited to add:
When I added " " around Europe/City it worked just fine.
-
- Joomla! Apprentice
- Posts: 19
- Joined: Sat Jun 27, 2009 10:21 am
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Hello. The solution for me was that it was a compatibility issue (PHP 5.3 not being compatible with Joomla) See this post...
http://forum.joomla.org/viewtopic.php?p=1810330
http://forum.joomla.org/viewtopic.php?p=1810330
- kazal
- Joomla! Enthusiast
- Posts: 104
- Joined: Tue Jan 13, 2009 4:52 am
- Location: Dhaka,Bangladesh.
- Contact:
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Thanks for @"dhuelsmann" .
Its a gr8 solution for my server.
It works fine !!!!!!!!!!
Its a gr8 solution for my server.
It works fine !!!!!!!!!!
K@Z@L. http://www.thechuadanga.comhttp://people.joomla.org/groups/viewgro ... adesh.html
Abacus Bangladesh NMC LTD.[email protected] *** Cell: +8801818318631
Abacus Bangladesh NMC LTD.[email protected] *** Cell: +8801818318631
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue Mar 02, 2010 10:03 am
Re: Warning: strtotime() [function.strtotime]: It is not safe to
uh, in what file do i need to put this code in: php_value date.timezone Europe/Moscow?
the htacces or php.ini and where in the file..??
thanks,
the htacces or php.ini and where in the file..??
thanks,
- dhuelsmann
- Joomla! Master
- Posts: 19659
- Joined: Sun Oct 02, 2005 12:50 am
- Location: Omaha, NE
- Contact:
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Anywhere will work if it is not already there.dhuelsmann wrote:The solution is to set date.timezone in php.ini
Regards, Dave
Past Treasurer Open Source Matters, Inc.
Past Global Moderator
http://www.kiwaniswest.org
Past Treasurer Open Source Matters, Inc.
Past Global Moderator
http://www.kiwaniswest.org
-
- Joomla! Fledgling
- Posts: 4
- Joined: Sun Mar 07, 2010 4:32 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
i know next to nothing about joomla and php and whatever :/
what exactly do i do to fix this problem?
like what progrrams do i use and stuff?
what exactly do i do to fix this problem?
like what progrrams do i use and stuff?
-
- Joomla! Fledgling
- Posts: 3
- Joined: Fri Apr 04, 2008 8:26 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
There is something wrong with the code itself.
Go to C:\xampp\htdocs\libraries\joomla\utilities\date.php
Line 52 creates a function called __construct. Notice how the underscore is too long. Highlight part of it and you'll see that it's actually two underscores. This is a mistake. Highlight one of the underscores and delete it. You should end up with _construct. Notice how the underscore is shorter?
Now save and reload.
Happy coding!!!
Go to C:\xampp\htdocs\libraries\joomla\utilities\date.php
Line 52 creates a function called __construct. Notice how the underscore is too long. Highlight part of it and you'll see that it's actually two underscores. This is a mistake. Highlight one of the underscores and delete it. You should end up with _construct. Notice how the underscore is shorter?
Now save and reload.
Happy coding!!!
-
- Joomla! Fledgling
- Posts: 1
- Joined: Wed Mar 17, 2010 3:59 am
Re: Warning: strtotime() [function.strtotime]: It is not safe to
kanji2000 wrote:There is something wrong with the code itself.
Go to C:\xampp\htdocs\libraries\joomla\utilities\date.php
Line 52 creates a function called __construct. Notice how the underscore is too long. Highlight part of it and you'll see that it's actually two underscores. This is a mistake. Highlight one of the underscores and delete it. You should end up with _construct. Notice how the underscore is shorter?
Now save and reload.
Happy coding!!!
Thanks Master, its fix my Problem "Two Tumbs Up"
-
- Joomla! Apprentice
- Posts: 34
- Joined: Thu Mar 18, 2010 6:24 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Did I do this right? I'm still getting the error.
Should also mention that when i ditched the underscore from constructs none of my links worked.
Edit: I compared a past php.ini with the changes i just made and they are identical.
What would happen if I took php.php, php.ini, and .htaccess from my remote site and pasted them into my localhost directories? My remote site works but my local site has this error, their must be something I can do.
Should also mention that when i ditched the underscore from constructs none of my links worked.
Edit: I compared a past php.ini with the changes i just made and they are identical.
What would happen if I took php.php, php.ini, and .htaccess from my remote site and pasted them into my localhost directories? My remote site works but my local site has this error, their must be something I can do.
You do not have the required permissions to view the files attached to this post.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Fri Apr 04, 2008 8:26 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
TKM
Look at line 52. Notice how "__construct" has a very long underscore(__). There are actually two underscores. Delete only ONE of the underscores (_). The result should look like this
function _construct(
Notice how the underscore is now shorter. Save and reload.
As for the date.timezone = "America/Edmonton", just make sure that there is no semi-colon before that line of code.
Look at line 52. Notice how "__construct" has a very long underscore(__). There are actually two underscores. Delete only ONE of the underscores (_). The result should look like this
function _construct(
Notice how the underscore is now shorter. Save and reload.
As for the date.timezone = "America/Edmonton", just make sure that there is no semi-colon before that line of code.
-
- Joomla! Apprentice
- Posts: 34
- Joined: Thu Mar 18, 2010 6:24 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Strangely, removing the the extra underscore disconnected all of my links. Removing both crashed the hole site. As per my last post, all it needed was a reboot, to recognize the change to date.timezone = "".kanji2000 wrote:TKM
Look at line 52. Notice how "__construct" has a very long underscore(__). There are actually two underscores. Delete only ONE of the underscores (_). The result should look like this
function _construct(
Notice how the underscore is now shorter. Save and reload.
As for the date.timezone = "America/Edmonton", just make sure that there is no semi-colon before that line of code.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Fri Apr 04, 2008 8:26 pm
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Ah, I see. So you removed only one underscore and it disconnected your links. That's not good. Sorry to hear that. Not sure why but it made all my error messages disappear. Weird. Time for more testing...
Happy Coding!
Happy Coding!
- xcronix
- Joomla! Apprentice
- Posts: 14
- Joined: Sun Oct 01, 2006 12:44 am
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Thank Youkanji2000 wrote:There is something wrong with the code itself.
Go to C:\xampp\htdocs\libraries\joomla\utilities\date.php
Line 52 creates a function called __construct. Notice how the underscore is too long. Highlight part of it and you'll see that it's actually two underscores. This is a mistake. Highlight one of the underscores and delete it. You should end up with _construct. Notice how the underscore is shorter?
Now save and reload.
Happy coding!!!
-
- Joomla! Fledgling
- Posts: 4
- Joined: Wed Jul 30, 2008 6:56 am
Re: Warning: strtotime() [function.strtotime]: It is not safe to
Greetings,
After installing the latest version of Joomla locally, I too experienced "Warning: date () [function.date]: It is not safe to Rely on the system's..." errors all over the screen. I tried the double underscore fix, but this killed the default links with 404 Page Not Found Errors, so I guess the double underscore is not a actually a bug after all.
I finally got it working (thanks to dhuelsmann) by editing the date.timezone line in the php.ini file (it was ;commented out) and this worked perfectly. If you are also experiencing this error, simply edit the date.timezone line in your php.ini file, or at least remove the ; comment at the start of the line. Don't forget to stop and restart the Apache server for the changes to take affect.
All the best,
Shane.
After installing the latest version of Joomla locally, I too experienced "Warning: date () [function.date]: It is not safe to Rely on the system's..." errors all over the screen. I tried the double underscore fix, but this killed the default links with 404 Page Not Found Errors, so I guess the double underscore is not a actually a bug after all.
I finally got it working (thanks to dhuelsmann) by editing the date.timezone line in the php.ini file (it was ;commented out) and this worked perfectly. If you are also experiencing this error, simply edit the date.timezone line in your php.ini file, or at least remove the ; comment at the start of the line. Don't forget to stop and restart the Apache server for the changes to take affect.
All the best,
Shane.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Sun May 09, 2010 5:00 pm
Re: Warning: strtotime() [function.strtotime]: It is not saf
A class __construct() function should have 2 underscores.
See http://www.php.net/manual/en/language.oop5.decon.php
Do not change JDate's __construct(), as was suggested in kanji2000's post.
See http://www.php.net/manual/en/language.oop5.decon.php
Do not change JDate's __construct(), as was suggested in kanji2000's post.
-
- Joomla! Enthusiast
- Posts: 134
- Joined: Thu Dec 03, 2009 9:45 am
Re: Warning: strtotime() [function.strtotime]: It is not saf
Hey dhuelsmann! I had the same problem and your explanation helped me fix it. Just wanted to say thanks a lot!dhuelsmann wrote:Per this http://ezpedia.org/wiki/en/ez/php5_technical_notes, the problem is probably in the server's php.ini file:
The solution is to set date.timezone in php.ini, if the TZ environment variable isn't set:.. where "Europe/Brussels" was used as an example.Code: Select all
[Date] ; Defines the default timezone used by the date functions date.timezone = "Europe/Brussels"
If you aren't the administrator of this site, you may need to communicate this information to him/her. I'd expect the admin does not see this, or it would have been fixed already.
If you can't get your administrator to fix the php.ini file, and if your host allows php directives in .htaccess, you can add this command to your .htaccess in Joomla root.where "yourServerTimeZone" is one of timezones listed here: http://php.net/manual/timezones.phpCode: Select all
php_value date.timezone yourServerTimeZone
For example :Code: Select all
php_value date.timezone Europe/Moscow or php_value date.timezone America/Chicago
-
- Joomla! Intern
- Posts: 74
- Joined: Sun Feb 14, 2010 10:56 pm
Re: Warning: strtotime() [function.strtotime]: It is not saf
I had this error and have discovered one very important step that was mentioned in the passing. You must Stop/Start Apache in the XAMPP Control Panel. This fixed my problem, my php.ini file was alreaduy correct so there was no need to make any other alterations.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Thu May 20, 2010 4:47 pm
Re: Warning: strtotime() [function.strtotime]: It is not saf
Hello,
I am having the same issue here, on a joomla site that is already online.
I use joomla 1.5.15 and the PHP environment is 5.3.2
I have tried both of the solutions suggested (htaccess and php.ini), but without success.
Can anybody think of something else to check or modify ?
Thanks in advance.
I am having the same issue here, on a joomla site that is already online.
I use joomla 1.5.15 and the PHP environment is 5.3.2
I have tried both of the solutions suggested (htaccess and php.ini), but without success.
Can anybody think of something else to check or modify ?
Thanks in advance.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Thu May 20, 2010 4:47 pm
Re: Warning: strtotime() [function.strtotime]: It is not saf
Allright, after double-checking with the server admin person, turned out the culprit WAS the php.ini file.
So this solution worked for me as well! :-)
So this solution worked for me as well! :-)
-
- Joomla! Apprentice
- Posts: 7
- Joined: Mon Jan 14, 2008 11:14 pm
Re: Warning: strtotime() [function.strtotime]: It is not saf
Thanks!
FYI: To set PHP timezone on OSX Snow Leopard:
http://www.macosxhints.com/article.php? ... 1101932728
FYI: To set PHP timezone on OSX Snow Leopard:
http://www.macosxhints.com/article.php? ... 1101932728
-
- Joomla! Fledgling
- Posts: 4
- Joined: Sun Jul 18, 2010 6:40 am
Re: Warning: strtotime() [function.strtotime]: It is not saf
This really works! Thanks so much :-) Ciaokanji2000 wrote:There is something wrong with the code itself.
Go to C:\xampp\htdocs\libraries\joomla\utilities\date.php
Line 52 creates a function called __construct. Notice how the underscore is too long. Highlight part of it and you'll see that it's actually two underscores. This is a mistake. Highlight one of the underscores and delete it. You should end up with _construct. Notice how the underscore is shorter?
Now save and reload.
Happy coding!!!
-
- Joomla! Fledgling
- Posts: 4
- Joined: Sun Jul 18, 2010 6:40 am
Re: Warning: strtotime() [function.strtotime]: It is not saf
WOW - this really works, thanks so much :-)
-
- Joomla! Fledgling
- Posts: 1
- Joined: Thu Jul 22, 2010 6:46 pm
Re: Warning: strtotime() [function.strtotime]: It is not saf
If none of the above solutions work for you,
try editing utilities/date.php file to include the following line.
putenv("TZ=America/New_York");
Ofourse inside <?php ?>.
njoy coding
Mohan
try editing utilities/date.php file to include the following line.
putenv("TZ=America/New_York");
Ofourse inside <?php ?>.
njoy coding
Mohan
-
- Joomla! Fledgling
- Posts: 1
- Joined: Tue Aug 17, 2010 7:05 pm
Re: Warning: strtotime() [function.strtotime]: It is not saf
In my case I was using XAMPP server portable edition (Windows) and I just did the followings:
1. searched for php.ini file in the extracted files
2. After openning php.ini I using Ctrl+F searched for "[Date]"
3. I added the line bellow [Date]: date.timezone = "Asia/Dhaka"
After restarting Apache, the problem solved!
1. searched for php.ini file in the extracted files
2. After openning php.ini I using Ctrl+F searched for "[Date]"
3. I added the line bellow [Date]: date.timezone = "Asia/Dhaka"
After restarting Apache, the problem solved!