Results 1 to 8 of 8
  1. #1
    Join Date
    May 2011
    Location
    Tennessee
    Posts
    377
    Plugin Contributions
    0

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

    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?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    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.

  3. #3
    Join Date
    May 2011
    Location
    Tennessee
    Posts
    377
    Plugin Contributions
    0

    Default 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?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: ERROR: date.timezone not set in php.ini on local Windows 2008 server

    Quote Originally Posted by jodean View Post
    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.
    .

    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.

  5. #5
    Join Date
    Jun 2009
    Posts
    32
    Plugin Contributions
    0

    Default 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

  6. #6
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: ERROR: date.timezone not set

    Quote Originally Posted by Kjell Aa View Post
    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...
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  7. #7
    Join Date
    Jun 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: ERROR: date.timezone not set

    Quote Originally Posted by lhungil View Post
    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:

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

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

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

    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.

 

 

Similar Threads

  1. v151 cant start install get error : date.timezone not set in php.ini.
    By spidermn in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 23 Aug 2013, 03:32 AM
  2. ERROR: date.timezone not set in php.ini
    By shilo in forum Installing on a Linux/Unix Server
    Replies: 14
    Last Post: 22 Mar 2013, 10:26 PM
  3. v150 ERROR: date.timezone not set in php.ini
    By merlin57 in forum Installing on a Linux/Unix Server
    Replies: 7
    Last Post: 30 Dec 2012, 01:47 AM
  4. Replies: 6
    Last Post: 29 Aug 2012, 12:28 PM
  5. v150 Date.Timezone php.ini problems...
    By b14speedfreak in forum Installing on a Linux/Unix Server
    Replies: 6
    Last Post: 16 Aug 2012, 10:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR