ERROR: date.timezone not set in php.ini on local Windows 2008 server
I am trying to install Zen Cart on a Windows 2008 local server. MySQL and PHP both installed without any problem. I start the application localhost/shopdevel and the Zen Cart installation page displays. Then when I click on the Click here to begin I get the following error.
Quote:
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 get the PHP info and the timezone is set to America/Chicago.
What am I doing wrong?
Re: ERROR: date.timezone not set in php.ini on local Windows 2008 server
There are two places where one can set php.ini settings: "master" (which PHP uses server-wide) and "local" (customized per "site").
It's safest to set the correct timezone in BOTH, or if you only have "one" then of course set it in that one.
phpinfo will show you two columns, one being master and one being local.
Re: ERROR: date.timezone not set in php.ini on local Windows 2008 server
What is the names of the folders for the Master and Local?
Re: ERROR: date.timezone not set in php.ini on local Windows 2008 server
Quote:
Originally Posted by
jodean
What is the names of the folders for the Master and Local?
That's server-specific. But I'm sure that's all documented someplace that talks about how to configure your server. I'd start by searching online. But if you want to skip that, then search your server's harddrive for files named php.ini.
Re: ERROR: date.timezone not set in php.ini on local Windows 2008 server
How exactly can I avoid this error.
I have uploaded (via ftp) the latest zen-cart to my ISP host.
This is what the server info says:
Server OS: Linux 2.6.32-5-amd64 Database: MySQL 5.5.35-log
Server Date: 16/12/2013 22:23:07 Datebase Date: 16/12/2013 22:23:07
HTTP Server: Apache/2.2.16
PHP Version: 5.3.3-7+squeeze18 (Zend: 2.3.0)
Where do I change what to avoid the error I get:
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 am just past page 2 on the book of "php for dummies" so please explain using baby steps here.
Kjell
Re: ERROR: date.timezone not set
Quote:
Originally Posted by
Kjell Aa
How exactly can I avoid this error.
I have uploaded (via ftp) the latest zen-cart to my ISP host.
This is what the server info says:
Server OS: Linux 2.6.32-5-amd64 Database: MySQL 5.5.35-log
Server Date: 16/12/2013 22:23:07 Datebase Date: 16/12/2013 22:23:07
HTTP Server: Apache/2.2.16
PHP Version: 5.3.3-7+squeeze18 (Zend: 2.3.0)
Where do I change what to avoid the error I get:
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 am just past page 2 on the book of "php for dummies" so please explain using baby steps here.
Kjell
This is an error message commonly encountered in PHP > 5.3. Basically it says "your PHP environment is not configured with the correct timezone". You state the site is hosted on your ISP (not by you). The part highlighted in red will be the best way to fix the error (The hosting company can make the adjustment for your site).
One can read more about date.timezone on php.net. The article details what the date.timezone configuration setting does (and where it can be changed). Granted if a 3rd party is hosting the website (running the server), the information alone is not enough... The hosting provider may have other restrictions or may not provide access to change the necessary settings.
In the long run it is almost always better to have the hosting provider fix the PHP configuration for the hosted website (or switch to a different provider if they will not)... If one is running Zen Cart 1.5.2+ (and the hosting provider will not update the PHP environment or allow changing the environment)... As a workaround one can can edit "/includes/extra_configures/set_time_zone.php" and add your timezone where indicated...
Re: ERROR: date.timezone not set
Quote:
Originally Posted by
lhungil
This is an error message commonly encountered in PHP > 5.3. Basically it says "your PHP environment is not configured with the correct timezone". You state the site is hosted on your ISP (not by you). The part highlighted in red will be the best way to fix the error (The hosting company can make the adjustment for your site).
One can read more about
date.timezone on php.net. The article details what the date.timezone configuration setting does (and where it can be changed). Granted if a 3rd party is hosting the website (running the server), the information alone is not enough... The hosting provider may have other restrictions or may not provide access to change the necessary settings.
In the long run it is almost always better to have the hosting provider fix the PHP configuration for the hosted website (or switch to a different provider if they will not)... If one is running Zen Cart 1.5.2+ (and the hosting provider will not update the PHP environment or allow changing the environment)... As a workaround one can can edit "/includes/extra_configures/set_time_zone.php" and add your timezone where indicated...
Or (I found out) you can edit one of the following statements into 3 php-sources:
@ini_set('date.timezone', 'Europe/Oslo');
//or..
putenv("TZ='Europe/Oslo");
//or..
date_default_timezone_set('Europe/Oslo');
//or..
date.timezone = Europe/Oslo ;
to the required php files ie: index.php in the Root, the Admin and the zc_install directories
I used the first one and placed the statement at the of the Source, after the comments:
index.php:
Quote:
<?php
/**
* index.php represents the hub of the Zen Cart MVC system
*
* Overview of flow
* <ul>
* <li>Load application_top.php - see {@tutorial initsystem}</li>
* <li>Set main language directory based on $_SESSION['language']</li>
* <li>Load all *header_php.php files from includes/modules/pages/PAGE_NAME/</li>
* <li>Load html_header.php (this is a common template file)</li>
* <li>Load main_template_vars.php (this is a common template file)</li>
* <li>Load on_load scripts (page based and site wide)</li>
* <li>Load tpl_main_page.php (this is a common template file)</li>
* <li>Load application_bottom.php</li>
* </ul>
*
* @package general
* @copyright Copyright 2003-2005 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license
http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: index.php 2942 2006-02-02 04:41:23Z drbyte $
*/
/**
* Load common library stuff
*/
@ini_set('date.timezone', 'Europe/Oslo'); // to the required php files ie: index.php in the Root, the Admin and the zc_install directories
require('includes/application_top.php');
Worked like a dream.
I would suppose most people know which part of the world they are located in.
These are the time zones supported by php: http://php.net/manual/en/timezones.php
Kjell
Re: ERROR: date.timezone not set
That's basically the approach used by this patch, but the patch puts it in a more effective place:
http://www.zen-cart.com/showthread.p...HP-5-3-5-4-5-5