A bug of PHP or mis-configuration ???

Discussion in 'Site & Server Administration' started by NNT_, Feb 27, 2011.

  1. #1
    Hi, few days ago. My hosting site, clients always meet this error:

    I don't know what is this, i tried to find date() function in PHP Configure but i can't. Someone told me that caused by Plugins, so here is my current plugin on servers:

    Addon Script Manager
    ConfigServer Mail Manage
    ConfigServer Mail Queues
    ConfigServer Security&Firewall
    Configure ClamAV Scanner
    Game Server Management
    LiteSpeed Web Server
    Mod Security
    Munin Service Monitor
    Setup Spamd Startup Configuration
    Softaculous - Instant Installs
    Website Maintenance Service by Edit.com

    And my current PHP version is 5.3.4

    What do you think about this ??? I need some help :(

     
    NNT_, Feb 27, 2011 IP
  2. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #2
    It's normal unless you either set date.timezone = "GMT" in php.ini or in your code you use date_default_timezone_set('GMT'); it's not that the date function doesn't exist it is that the PHP doesn't know what the timezone is that it should be using.

    Assuming you have access to php.ini then just set a default in there and the error will go away.

    I've used GMT as an example you'd need to put your real timezone in there.
     
    tolra, Feb 27, 2011 IP
  3. NNT_

    NNT_ Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks tolra, but could you show me which option i must edit to default ? I can't find
    date.timezone in php.ini on whm ????
     
    NNT_, Feb 28, 2011 IP
  4. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #4
    I'm assuming this is your server so:

    - Login via SSH as root
    - Edit /usr/local/lib/php.ini
    - Below
     add:
        date.timezone = "Australia/Perth"
    - Save the file
    - Restart apache (not needed if you use suPHP)
    
    When doing the edit change the timezone to be yours or the one you want for the server.
    PHP:
     
    tolra, Feb 28, 2011 IP
  5. NNT_

    NNT_ Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
     
    NNT_, Feb 28, 2011 IP
  6. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #6
    WHM root is the same as SSH root unless your host admin has blocked access in which case get your server admin to fix it for you.
     
    tolra, Feb 28, 2011 IP