Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2012
    Posts
    11
    Plugin Contributions
    0

    bug Date.Timezone php.ini problems...

    Click image for larger version. 

Name:	phpinfo.jpg 
Views:	224 
Size:	22.3 KB 
ID:	10977Click image for larger version. 

Name:	error.jpg 
Views:	178 
Size:	18.3 KB 
ID:	10976Hi Guys,

    I know that there has been a lot written about this already. But I have been beating myself for about 2 weeks (well during the evening), trying to do a first time install of Zencart 1.5.

    I am running on a LAMP stack on Ubuntu 12.04. I have managed to configure Virtual Hosting to work. This is so that I can work with Joomla and Drupal for test sites and I was planning on doing the same with Zencart. Makes things a bit easier for me than having to hassle of using a test site online with all the permission issues etc..

    Anyhow, I went through the install documentation and did everything mentioned pre-install - essentially renaming the dist-configure.php to configure.php. Hit the URL and got presented with the install screen. However when I click the hyperlink "click here to begin installation" (prosume that will install it for me) I get the following error:

    Code:
    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 saw the post up on the ubuntu forum (http://ubuntuforums.org/showthread.php?t=1703807) as well as the one on the zen forum (http://www.zen-cart.com/showthread.p...-date-timezone).

    I have tried at length to go through these, but they don't seem to make any difference. As near as I can see it I have set the date.timezone setting. I even went to the length of dumping a small file which runs the
    Code:
    php_info();
    function to see what I set. This shows the default timezone set as "Europe/London". As far as I can see it I have set it correctly in the php.ini (located at /etc/php5/apache2), I set it to:

    Code:
    date.timezone = "europe/London"
    I have also tried adding it in the application_top.php file under zencart/includes. I included it in the file as follows:

    Code:
    <?php
    
    
    /**
     * application_top.php Common actions carried out at the start of each page invocation.
     *
     * Initializes common classes & methods. Controlled by an array which describes
     * the elements to be initialised and the order in which that happens.
     * see {@link  http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details.
     *
     * @package initSystem
     * @copyright Copyright 2003-2011 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: application_top.php 19731 2011-10-09 17:20:30Z wilt $
     */
    /**
     * inoculate against hack attempts which waste CPU cycles
     */
    @ini_set('date.timezone', 'Europe/London'); 
    
    $contaminated = (isset($_FILES['GLOBALS']) || isset($_REQUEST['GLOBALS'])) ? true : false;
    $paramsToAvoid = array('GLOBALS', '_COOKIE', '_ENV', '_FILES', '_GET', '_POST', '_REQUEST', '_SERVER', '_SESSION', 'HTTP_COOKIE_VARS', 'HTTP_ENV_VARS', 'HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_POST_FILES', 'HTTP_RAW_POST_DATA', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS');
    $paramsToAvoid[] = 'autoLoadConfig';
    $paramsToAvoid[] = 'mosConfig_absolute_path';
    $paramsToAvoid[] = 'hash';
    $paramsToAvoid[] = 'main';
    Has anyone got any ideas where I am going wrong or any log files I could try looking in? I attached a few screendumps to kinda show that I am not making it all up!

    I would appreciate any help in advance because this is really starting to do my head in.

    I like to think that I reasonably technically proffiant, I have moved and clonded drupal installs easily, and I have done the same thing with Joomla and I am not affraid to get my hands dirty. Beginning to doubt myself a lot at the moment...

    ...anyhow, thanks in advance of any posts / suggestions.

    Mark.
    Last edited by b14speedfreak; 14 Aug 2012 at 10:16 PM.

  2. #2
    Join Date
    Jan 2004
    Posts
    65,286
    Blog Entries
    7
    Plugin Contributions
    227

    Default Re: Date.Timezone php.ini problems...

    1. If that error message is being displayed, then the RUNNING instance of PHP does NOT have the value set in the MASTER php.ini configuration file.
    It is running a very simple PHP ini_get() function call to read it, and if it reads as blank then the error message is displayed. If the value is set and is the master configuration (not just a temporary setting in a localized custom php.ini or .htaccess) then it will be read as the actual value and not come back blank, and then the error message won't appear.

    2. Fudging it by forcing an ini_set in application_top isn't really a good idea, especially if you only do it in the zc_install version of application_top as the links you referenced suggest doing (but which you didn't do: you touched a different file). By forcing it in a Zen Cart file you effectively place a bandage on a situation that will likely burn you later. Both of those articles point to editing a zc_install file, which ONLY tricks the installer. The installer is trying to HELP you by making sure you fix something IMPORTANT before you carry on. If you don't fix the timezone setting problem, then date calculations in your store will not work correctly and then you'll be back here with questions about bizarre situations that should never happen.

    So, sure, if you want to merely bandage your Zen Cart instead of fixing your server, go ahead, be sure to fudge it in ALL the application_top files. But it's not the best solution. That's why all the help text and other articles advise to fix the problem on the server config, and not how to trick Zen Cart into thinking everything's just fine.
    .

    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
    Aug 2012
    Posts
    11
    Plugin Contributions
    0

    Default Re: Date.Timezone php.ini problems...

    I don't mind going down the hard route of trying to make Zen Cart work. Thats not a problems to me. I just don't understand why when I altered it in the php.ini file located at /etc/php5/apache it did not accept it. Also, I have taken out the line in the application_top.php file and left in the line in php.ini file as previously mentioned. The installer still sticks.

    The question I guess, is that I need to locate the master php.ini (which I thought I had done). I guess I shall have to try and work out how locate this some other way.

    I understand where you are coming from with the application_top.php file point. Any ideas how I could locate the php.ini file that I am after?

    Thanks again for the input, just feel like I am going mad with this...

    Mark.

  4. #4
    Join Date
    Aug 2012
    Posts
    11
    Plugin Contributions
    0

    Default Re: Date.Timezone php.ini problems...

    ok so I figured it out. I was being a dumb arse - nothing new there. To be fair though, I don't feel like its 100% clear to be honest.

    so under /etc/php5 I have 2 directories with php.ini files in them:

    apache2
    apache2filter

    Now I initially the apache2 php.ini file with the time zone. I figured that had sorted it out. It was only with the above post, that I noticed the second apache2filter with php.ini under it. I altered that file also, and hey presto...one install that looks like it might work and gets me past my error message.

    I mean I may of been dumb, but I don't think that its all that obvious to be honest...but I guess I should have read a bit more...


    ...thanks again one and all for reading...have a good day, off to go and sand some boats for my money...

    Mark.

  5. #5
    Join Date
    Jan 2004
    Posts
    65,286
    Blog Entries
    7
    Plugin Contributions
    227

    Default Re: Date.Timezone php.ini problems...

    Assuming your PHP skills are up to it, you could tell application_top to read the value and output it to you. You could do that for not only the timezone setting but also the ini filename. That way you'll know what Zen Cart is being handed when it asks for the information from PHP.

    In my case, the output of phpinfo() tells me the same thing that Zen Cart tells me, which is also the same as what my php.ini is set to.
    I've no idea why yours is telling you something different, unless it's the wrong php.ini or the changes in that php.ini haven't taken effect because PHP/Apache haven't been restarted since the changes.

    I've tried making mine do what you say yours is doing, and the only way I can break it is to put bad data in my php.ini file.
    .

    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.

  6. #6
    Join Date
    Jan 2004
    Posts
    65,286
    Blog Entries
    7
    Plugin Contributions
    227

    Default Re: Date.Timezone php.ini problems...

    I guess we were typing at the same time.

    Glad you got it sorted out!

    Indeed, multiple configurations can be tricky to manage ;)
    .

    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.

  7. #7
    Join Date
    Aug 2012
    Posts
    11
    Plugin Contributions
    0

    Default Re: Date.Timezone php.ini problems...

    Yeah, I guess thats the problem with virtual hosting. Sometimes its hard to figure out which php.ini file is being read. I guess thats really the route I should have gone down and researched. I guess its just been a while since I encountered such a message.

    Thanks for all the help, I appreciate it a lot, especially when so much has already been written on the subject. As you say I guess your better off sorting it properly in the first place. I know with ini settings from previous tuning with drupal you can do it in the settings.php file. Its pretty common to do those changes there I think, especially if you don't have access to php.ini for whatever server reason.

    Anyhow, thanks again,

    Mark.

 

 

Similar Threads

  1. v151 ERROR: date.timezone not set in php.ini on local Windows 2008 server
    By jodean in forum Installing on a Windows Server
    Replies: 7
    Last Post: 22 Apr 2014, 06:22 PM
  2. 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
  3. 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
  4. 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
  5. PHP.ini date timezone issue
    By meteoros in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 25 Feb 2012, 07:03 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