The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpinfo]

Discussion in 'General Discussion' started by potionslotions, Oct 17, 2011.

  1. potionslotions

    Joined:
    Oct 17, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi

    I recently updated the server to php 5.3.8 and apache 2.2.21, but since doing this I'm getting errors on sites because the timezone has not been set!!

    I've added/checked to (I think) every location of php.ini in bold that I thought needed the following:

    date.timezone="Europe/London"

    root@hosting [/]# locate php.ini
    /home/cpeasyapache/src/php-5.3.8/php.ini-development
    /home/cpeasyapache/src/php-5.3.8/php.ini-production
    /scripts.20110911.163001.8412/php.ini
    /usr/lib/php.ini
    /usr/local/cpanel/3rdparty/etc/php.ini
    /usr/local/cpanel/3rdparty/etc/php.ini.dist
    /usr/local/cpanel/3rdparty/etc/php.ini.keep
    /usr/local/cpanel/3rdparty/etc/horde/php.ini
    /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
    /usr/local/cpanel/3rdparty/etc/phppgadmin/php.ini
    /usr/local/cpanel/3rdparty/etc/roundcube/php.ini
    /usr/local/cpanel/scripts/php.ini
    /usr/local/lib/php.ini
    /usr/local/lib/php.ini,v

    [h=2]date[/h]
    Warning: phpinfo() [function.phpinfo]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for 'BST/1.0/DST' instead in /home/envirome/public_html/phpinfo.php on line 2
    [TABLE="width: 600"]

    [TD="class: e"]date/time support [/TD]
    [TD="class: v"]enabled [/TD]

    [TD="class: e"]"Olson" Timezone Database Version [/TD]
    [TD="class: v"]2011.8 [/TD]

    [TD="class: e"]Timezone Database [/TD]
    [TD="class: v"]internal [/TD]

    [TD="class: e"]Default timezone [/TD]
    [TD="class: v"]Europe/London [/TD]
    [/TABLE]

    [TABLE="width: 600"]
    [TR="class: h"]
    DirectiveLocal ValueMaster Value[/TR]

    [TD="class: e"]date.default_latitude[/TD]
    [TD="class: v"]31.7667[/TD]
    [TD="class: v"]31.7667[/TD]

    [TD="class: e"]date.default_longitude[/TD]
    [TD="class: v"]35.2333[/TD]
    [TD="class: v"]35.2333[/TD]

    [TD="class: e"]date.sunrise_zenith[/TD]
    [TD="class: v"]90.583333[/TD]
    [TD="class: v"]90.583333[/TD]

    [TD="class: e"]date.sunset_zenith[/TD]
    [TD="class: v"]90.583333[/TD]
    [TD="class: v"]90.583333[/TD]

    [TD="class: e"]date.timezone[/TD]
    [TD="class: v"]no value[/TD]
    [TD="class: v"]no value[/TD]
    [/TABLE]


    I understand that this can fixed by adding a setting within .htaccess but I don't fancy doing this for all sites, surely I've missed something but I can't figure it out.

    On every site in nice italics "no value".

    On a side note where does phpinfo() pull the directive settings such as sunrise, sunset etc they are not set within php.ini are they defaults!

    Please help.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    Did you put the date.timezone="Europe/London" entry into /usr/local/lib/php.ini file? If you did, does that individual account (envirome) have its own php.ini file? If it does, you will also need to put the line into that account's php.ini file.
     
  3. potionslotions

    Joined:
    Oct 17, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    Sorry for the late reply - I didn't think anybody had replied and using the power of Google found my original post.

    Yes this is the end output of the /usr/local/lib/php.ini file:


    ; Local Variables:
    ; tab-width: 4
    ; End:
    [date]
    date.timezone="Europe/London"

    And I cannot find any other php.ini file other than those listed below


    root@hosting [/usr/local/lib]# locate php.ini
    /home/cpeasyapache/src/php-5.3.8/php.ini-development
    /home/cpeasyapache/src/php-5.3.8/php.ini-production
    /scripts.20110911.163001.8412/php.ini
    /usr/lib/php.ini
    /usr/local/cpanel/3rdparty/etc/php.ini
    /usr/local/cpanel/3rdparty/etc/php.ini.dist
    /usr/local/cpanel/3rdparty/etc/php.ini.keep
    /usr/local/cpanel/3rdparty/etc/horde/php.ini
    /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
    /usr/local/cpanel/3rdparty/etc/phppgadmin/php.ini
    /usr/local/cpanel/3rdparty/etc/roundcube/php.ini
    /usr/local/cpanel/scripts/php.ini
    /usr/local/lib/php.ini
    /usr/local/lib/php.ini,v
    root@hosting [/usr/local/lib]#

    Also any changes I do to both /usr/local/lib/php.ini and /usr/lib/php.ini such as the following to turn off errors on sites:

    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ; - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
    ;
    ; - Show all errors except for notices
    ;
    error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

    ; Print out errors (as a part of the output). For production web sites,
    ; you're strongly encouraged to turn this feature off, and use error logging
    ; instead (see below). Keeping display_errors enabled on a production web site
    ; may reveal security information to end users, such as file paths on your Web
    ; server, your database schema or other information.
    display_errors = Off

    When you execute phpinfo or within Joomla none of my amends are reflected and I have restarted Apache from CPanel.

    Help!
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    Can you please put up a phpinfo file onto the account in question in the folder where the warnings are outputting so we can see where it is loading the php.ini file from?
     
  5. potionslotions

    Joined:
    Oct 17, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    Many thanks for getting back so soon.

    I created a new domain within cPanel /http://www.hireskip.org/phpinfo.php as you can see you get an error on the date and 'no value' is recorded against local value and master value.

    Both php.ini files on the server reflect PERFECTLY cPanel through the PHP configuration menu (Advanced) below in addition they reflect that display_errors is OFF a snippet of the screen dump is below, yet phpinfo on every site contradicts and claims no timezone and display_errors is ON.

    error1.PNG

    Thanks

    Martin
     
  6. potionslotions

    Joined:
    Oct 17, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    I tried to upload a screen shot of PHP Configuration within cPanel last night but it doesn't seem to have been uploaded. Anything you do within cPanel PHP Configuration does not reflect both the php.ini files. In the PHP Configuration window (under Advanced) I added Europe/London as the timezone and for a test also switched OFF display_errors. These are clearly visible with cPanel. I have created a new domain on the server and added the phpinfo : /http://www.hireskip.org/phpinfo.php

    For some reason the URL would not display it is on the domain hireskipDOTorg forwardslash phpinfo.php

    As you can see display_errors is ON and the timezone has not been updated!
     
    #6 potionslotions, Oct 25, 2011
    Last edited: Oct 25, 2011
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    Well that phpinfo does show it as /usr/local/lib/php.ini for the global php.ini file.

    Can you please grep for date.timezone in that file?

    Code:
    grep date.timezone /usr/local/lib/php.ini
    Otherwise, at this point in time, please open up a ticket in WHM > Support Center > Contact cPanel or using the link in my signature.
     
  8. potionslotions

    Joined:
    Oct 17, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    Thanks Tristan

    I ran the code and as you would expect it output:
    date.timezone="Europe/London"

    I have raised a ticket.

    Many thanks for your help.
     
  9. potionslotions

    Joined:
    Oct 17, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    cPanel Support fixed it.

    If anybody has the same problem as me - any change done within cPanel PHP configuration and within the ini files for php doesn't reflect phpinfo() on a site - I had an incorrect character in my php.ini file from an earlier amend to increase the execution time for scripts - this was commented out. Everything OK
     
  10. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Europe
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    I'd like to say that I've also had to add the date.timezone setting myself, otherwise all my websites generated thousands of errors.

    Unfortunately, this doesn't affect php apps running under cPanel (like roundcube) because cPanel uses a different php.ini, which doesn't have the date.timezone setting and thus those apps continue to generate these errors. For example, you may look at the roundcube error log here: /var/cpanel/roundcube/log/error and see the same errors.
     
  11. gkgcpanel

    gkgcpanel Well-Known Member

    Joined:
    Jun 6, 2007
    Messages:
    217
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    # locate php.ini | grep -v home
    /usr/local/cpanel/3rdparty/etc/php.ini
    /usr/local/cpanel/3rdparty/etc/php.ini,v
    /usr/local/cpanel/3rdparty/etc/php.ini.dist
    /usr/local/cpanel/3rdparty/etc/horde/php.ini
    /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
    /usr/local/cpanel/3rdparty/etc/phppgadmin/php.ini
    /usr/local/cpanel/3rdparty/etc/roundcube/php.ini

    You can modify the php.ini's in the above directories to include the date.timezone=('YOURTIME/ZONEHERE') line.
    That should (strong emphasis here) solve the issue with roundcube and other 3rd party applications.
     
  12. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Re: date.timezone no value in phpinfo() - Warning: phpinfo() [function.phpi

    This post details the proper way to revise the internal php.ini file for values:

    http://forums.cpanel.net/f145/abili...ory-allowed-cpanel-php-212492.html#post875692

    If you end up revising the /usr/local/cpanel/3rdparty/etc/php.ini file, it will get overwritten on cpsrvd (cPanel) restarts. You have to modify the php.ini.dist one instead and restart cPanel to push the changes. You'd also want to add it to the exclude list.
     
Loading...

Share This Page