Zen Cart Logo
Forums / Installing on a Linux/Unix Server / ERROR: date.timezone not set in php.ini

ERROR: date.timezone not set in php.ini

Views: 12,766

Results 1 to 8 of 8
3 Feb 2012, 1:15 PM
#1
merlin57 avatar

merlin57

New Zenner

Join Date:
Mar 2005
Posts:
22
Plugin Contributions:
0

ERROR: date.timezone not set in php.ini

Hi
Using a Linux dedicated server with fresh install of PHP 5.39

Cannot run the installer full error message is;
ERROR: date.timezone not set in php.ini. Please contact your hosting company to set the timezone in the server PHP configuration before continuing.
I've added the timezone information into the php.ini but the install still isn't able to install zen cart

Phpinfo here http://205008.com/phpinfo.php

date
date/time support enabled
"Olson" Timezone Database Version 2011.14
Timezone Database internal
Default timezone Europe/London

3 Feb 2012, 2:02 PM
#2
merlin57 avatar

merlin57

New Zenner

Join Date:
Mar 2005
Posts:
22
Plugin Contributions:
0

Re: ERROR: date.timezone not set in php.ini

Phpinfo removed as rebuilding server.

3 Feb 2012, 4:47 PM
#3
drbyte avatar

drbyte

Sensei

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

Re: ERROR: date.timezone not set in php.ini

merlin57:

ERROR: date.timezone not set in php.ini.
The message means exactly what it says.

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

27 Apr 2012, 1:02 PM
#4
spid3r1987 avatar

spid3r1987

Zen Follower

Join Date:
Jul 2009
Posts:
497
Plugin Contributions:
0

Re: ERROR: date.timezone not set in php.ini

DrByte:

The message means exactly what it says.
im having this problem but in my php.ini file i have got my timezone set...
but yet when i do phpinfo it doesn't show my timezone, any idea??? :D

i may not know how yet, but i soon will....i hope :)

27 Apr 2012, 3:25 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: ERROR: date.timezone not set in php.ini

The test is based on the server's master php.ini, and NOT a localized/override/custom php.ini file.

Talk to the server administrator for help in fixing the server's master PHP configuration to work correctly.

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

27 Apr 2012, 11:47 PM
#6
pinkasterisk avatar

pinkasterisk

New Zenner

Join Date:
Apr 2012
Location:
St. Louis Missouri "Insource to the Midwest!"
Posts:
1
Plugin Contributions:
0

Re: ERROR: date.timezone not set in php.ini

Your site http://205008.com is not loading at all it's redirecting to another site http://www.powerfurniture.com/(also yours?)

A traceroute to 205008.com verifies your host is in the UK which explains the timezone in the phpinfo. If you ask your host and they are worth their salt (and using virtual hosting on Apache) you should be able to request them to add a custom php.ini file directive to your site's virtual host container:

<VirtualHost 79.170.43.204:80>
[...]
PHPINIDir /var/www/205008.com
[...]
</VirtualHost>

But if it's a truly dedicated server you should be able to edit the php.ini file directly. And not be sharing a server with another customer.

29 Aug 2012, 11:19 AM
#7
robert2721996 avatar

robert2721996

New Zenner

Join Date:
Aug 2012
Posts:
4
Plugin Contributions:
0

Re: ERROR: date.timezone not set in php.ini

Note to php and zen cart experts: Could you please verify this below me and mention any pro's con's to other users!

Note to any sufferors of date.timezone not set error during instalation:
Please check for coments below before trying this method, not yet tested fully, only peform thi fix knowing what it affects or by having confirmation from a php/zen cart expert... As I am only 16.. :D nontheless have a read and coment pro's con's ps- only comment pros cons if 100% sure.. ;)

Solution:
Provided that you are able to change the Default timezone or even better the date.timezone in a phpinfo() file via any method other than the global php.ini file.. such as following:

@ini_set('date.timezone', 'Europe/London'); // to the required php files ie: index.php in the Root, the Admin and the zc_install directories
//or..
putenv("TZ='Europe/London");  // to the required php files ie: index.php in the Root, the Admin and the zc_install directories
//or..
date_default_timezone_set('Europe/London');  // to the required php files ie: index.php in the Root, the Admin and the zc_install directories
//or..
date.timezone = America/Chicago ; in the htaccess in the following: in the Root, the Admin and the zc_install directories
//or..
php_value date.timezone "America/Chicago" ; in the htaccess in the following: in the Root, the Admin and the zc_install directories

and the result is a changed timezone in phpinfo().. //Note: Check phpinfo() in all directories mentioned above^

Then you should be able to change this piece of code in ROOT/zc_install/includes/aplication_top.php:

if (PHP_VERSION >= '5.3' && ini_get('date.timezone') == '')
{
  die('ERROR: date.timezone not set in php.ini. Please contact your hosting company to set the timezone in the server PHP configuration before continuing.');
} elseif (PHP_VERSION >= '5.1') {
  $baseTZ = date_default_timezone_get();
  date_default_timezone_set($baseTZ);
  unset($baseTZ);
}

For this one:

if (PHP_VERSION >= '5.1') {
  $baseTZ = date_default_timezone_get();
  date_default_timezone_set($baseTZ);
  unset($baseTZ);
}

or.. perhaps even better would be to substitute: // because it checks local settings that would be changed by the five methods mentoned above

if (PHP_VERSION >= '5.3' && ini_get('date.timezone') == '')

for:

if (PHP_VERSION >= '5.3' && date_default_timezone_get('date.timezone') == '')

the effect yet to be found.. but what you are infact doing is removing a check that is not necessary, because in live mode one of the five modes mentioned above to change the default timezone of your server will be sufficient to run Zen cart v1.5

30 Dec 2012, 12:47 AM
#8
carobessi avatar

carobessi

New Zenner

Join Date:
Dec 2012
Posts:
1
Plugin Contributions:
0

Re: ERROR: date.timezone not set in php.ini

** spam removed **