Warning: strtotime() [function.strtotime]: It is not safe to

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

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.
stckhlm
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue May 03, 2011 3:07 am

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by stckhlm » Tue May 03, 2011 3:13 am

It's very helpful, thanks for that

sitehost
Joomla! Apprentice
Joomla! Apprentice
Posts: 33
Joined: Sun Feb 24, 2008 5:22 am

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by sitehost » Fri May 06, 2011 7:50 pm

Changing the __construct is not the answer. It will cause you more issues that way.. please check the following first:

#1. Check your Php.ini file to reflect your time zone
date.timezone America/New_York
then restart apache.


#2. You can add this to the date.php file:
date_default_timezone_set('America/New_York');

The issue appears to be with Php 5.3 and above. just keep this in mind.

User avatar
STIN
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Tue Jul 19, 2011 10:02 pm

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by STIN » Tue Jul 19, 2011 10:05 pm

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!!!

:D
OMGZ! THANK YOU!! I WAS CRUMBLING FOR A WEEK OVER THIS! YOU RULE!! :D
~stin
Biotrends Intl.

xodiak
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Jul 30, 2011 3:18 pm

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by xodiak » Sat Jul 30, 2011 3:29 pm

@dhuelsmann

Brilliant. I was getting timezone errors all over my Joomla page. This fixed it.
dhuelsmann wrote: if your host allows php directives in .htaccess, you can add this command to your .htaccess in Joomla root.
Code:
php_value date.timezone yourServerTimeZone
Thanks!

LoonyTune
Joomla! Apprentice
Joomla! Apprentice
Posts: 49
Joined: Fri Aug 05, 2011 11:12 am

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by LoonyTune » Mon Aug 08, 2011 3:50 am

Pancakes wrote:Off of the research I have done, I have discovered that the reason this issue may occur is because of PHP 5.3

Downgrading or installing PHP 5.2 may resolve this error from occurring. I have not tested this myself but plan to.
I downgraded to 5.2 and all my errors dissapeared.

Cheers

User avatar
bossies
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 112
Joined: Tue Oct 11, 2005 3:53 pm
Location: Malmesbury - South Africa
Contact:

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by bossies » Thu Aug 11, 2011 7:29 am

thanks @dhuelsmann worked for me as well!
Malmesbury - South Africa
http://www.voiceconnect.co.za Voiceconnect
http://www.atmalmesbury.co.za

User avatar
hannylicious
Joomla! Explorer
Joomla! Explorer
Posts: 292
Joined: Fri Feb 22, 2008 2:57 pm
Location: Chicago, IL
Contact:

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by hannylicious » Thu Sep 01, 2011 4:40 am

I know this is an older thread, but Dhuelsmann's recommendation of adding the correct code to the php.ini worked out perfectly for me!
Pushpin Designs
www.pushpindesigns.com

tawhid111
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Sep 18, 2011 11:02 pm

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by tawhid111 » Sat Oct 01, 2011 6:39 pm

if none of those solution worked add this to your index.php
last resort solution! :D

Code: Select all

error_reporting(0);
@ini_set(‘display_errors’, 0);

sbohler
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Jan 23, 2011 10:10 pm

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by sbohler » Sat Oct 15, 2011 8:46 pm

auntyfleen wrote: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
Bingo! Thank you, Auntyfleen.

dimi2011
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Nov 10, 2011 7:50 am

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by dimi2011 » Tue Nov 15, 2011 9:22 am

My problem was caused by my shared hosting server not running the correct version of PHP. I added this line, AddType x-mapp-php5 .php, in my .htaccess to the root of my site and it immediately solved the problem.

Rollmodl
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Sun Nov 23, 2008 3:32 pm

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by Rollmodl » Thu Dec 22, 2011 1:11 am

LoonyTune wrote:
Pancakes wrote:Off of the research I have done, I have discovered that the reason this issue may occur is because of PHP 5.3

Downgrading or installing PHP 5.2 may resolve this error from occurring. I have not tested this myself but plan to.
I downgraded to 5.2 and all my errors dissapeared.

Cheers
I'm also having the same issue. Would someone like to fix this for me?

mizreqat
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jun 13, 2011 10:50 am

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by mizreqat » Mon May 14, 2012 8:43 am

;) :D

For GoDaddy and others:

Why isn't my php.ini file taking effect?
Answer:
http://support.godaddy.com/help/5647/wh ... ing-effect

Why did I receive a timezone error with my PHP website?
Answer:
http://support.godaddy.com/help/6703/wh ... hp-website

What is my timezone?
Answer:
http://www.php.net/manual/en/timezones.php

;) :D

tajudeen
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Apr 22, 2013 5:56 am

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by tajudeen » Mon Apr 22, 2013 6:05 am

Dear All :)

My website is hosted in third party hosting provider.
I have added code date_default_timezone_set ("America/New_York"); in my date.php file

But still I am getting the error in line 56.

I don't know will it get effected immediately or should we ask the provider to do something at their end

please suggest.

Thanks in advance,

Tajudeen

jmccuneprJF
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Mar 17, 2010 11:54 am

Re: Warning: strtotime() [function.strtotime]: It is not saf

Post by jmccuneprJF » Tue May 07, 2013 12:51 pm

sitehost wrote:Changing the __construct is not the answer. It will cause you more issues that way.. please check the following first:

#1. Check your Php.ini file to reflect your time zone
date.timezone America/New_York
then restart apache.

#2. You can add this to the date.php file:
date_default_timezone_set('America/New_York');

The issue appears to be with Php 5.3 and above. just keep this in mind.
THANK YOU for posting this helpful material.

I was getting errors suddenly, this morning, matching the description in this post, on the front end and back end of my live site. (Not sure what version of PHP my host is using--probably the latest--hosted by Siteground.)

The steps suggested above worked to apparently completely clear the errors--in both cases the suggested code was added to the end of the files referred to. Step #1 fixed the front end errors which were appearing probably at the top of every site page. Step #2 fixed the back end errors which were showing in the Articles manager.

Joomla 1.5.26, live site, on Linux server
twinoakscommunity.org


Locked

Return to “Administration 1.5”