title: "phpinfo(): It is not safe to rely on the system's timezone settings..."
body: <p>While running a php installation script for Blue.box (front end to FreeSwitch PBX), I get this error about a timezone failure.</p>
  
  <p>Then I start digging.  I'm not sure what is going on at this point.  But here is what I have:</p>
  
  <p>I created an info.php file in my public_html directory that contains a single line: 
        </p>
  
  <p>And I get this error and output</p>
  
  <blockquote>
    <p>Warning: phpinfo(): It is not safe to rely on the system's timezone
    settings. You are <em>required</em> 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 'America/New_York' for
    'EDT/-4.0/DST' instead in /home/0default/public_html/info.php on line
    1</p>
  </blockquote>
  
  <pre><code>date/time
  
       support    enabled
      "Olson" Timezone Database Version   0.system
      Timezone Database   internal
      Default timezone    America/New_York
  
      Directive   Local Value Master Value
      date.default_latitude   31.7667 31.7667
      date.default_longitude  35.2333 35.2333
      date.sunrise_zenith 90.583333   90.583333
      date.sunset_zenith  90.583333   90.583333
      date.timezone   America/New_York    America/New_York
  </code></pre>
  
  <p></p>
  
  <p>I created a file /etc/php.d/timezone.ini with the following:</p>
  
  <pre><code>[root@mercury php.d]# cat timezone.ini
  ; default time zone
  date.timezone='America/New_York'
  [root@mercury php.d]#
  </code></pre>
  
  <p>I'm able to change timezone to America/Los_Angeles (for example), and after apache reboot the "date.timezone" field changes correctly.</p>
  
  <p>But I still get the error.</p>
  
  <p>Any ideas?</p>
  
  <p>--- Additional note ---</p>
  
  <p>If I change the /etc/php.d/timezone.ini file:</p>
  
  <pre><code>[root@mercury php.d]# cat timezone.ini
  ; default time zone
  date.timezone='America/Los_Angeles'
  </code></pre>
  
  <p>I can cause a change to the info.php output:</p>
  
  <p>date</p>
  
  <p>Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are <em>required</em> 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 'America/New_York' for 'EDT/-4.0/DST' instead in /home/0default/public_html/info.php on line 1</p>
  
  <pre><code>date/time support   enabled
  "Olson" Timezone Database Version   0.system
  Timezone Database   internal
  Default timezone    America/New_York
  
  Directive   Local Value Master Value
  date.default_latitude   31.7667 31.7667
  date.default_longitude  35.2333 35.2333
  date.sunrise_zenith 90.583333   90.583333
  date.sunset_zenith  90.583333   90.583333
  date.timezone   America/Los_Angeles America/Los_Angeles
  </code></pre>
  
  <p>--- Additional note ---</p>
  
  <p>For those who are learning (as I am), several .ini files are loaded.  In the info.php output:</p>
  
  <pre><code>Configuration File (php.ini) Path   /etc
  Loaded Configuration File   /home/0default/etc/php5/php.ini
  Scan this dir for additional .ini files /etc/php.d
  Additional .ini files parsed    /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/json.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_odbc.ini, /etc/php.d/pdo_pgsql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/pgsql.ini, /etc/php.d/phar.ini, /etc/php.d/snmp.ini, /etc/php.d/sqlite3.ini, /etc/php.d/timezone.ini, /etc/php.d/wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlrpc.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zip.ini
  </code></pre>
  
  <p>The first one loaded is /etc/php.ini, then the "loaded configuration file", then the "scan this dir" files.  </p>
  
  <p>So for example, one should be able to create a number of php web sites in different default timezones.  Set the master default in /etc/php.ini, then allow each of the web sites to have a different time zone as identified in the "loaded..." section.  Then, if one is concerned about any overrides, the master can again override with the /etc/php.d files.</p>
  
  <p>I've tried changing the "date.timezone" in each of the three locations, and successfully change the date.timezone as displayed by the info.php... but it does not modify the "Default timezone" value, which is the value that is causing the error.</p>
  
  <p>Another note, the .php script that I am running is actually Blue.box, a front end to FreeSwitch.  So... I am hesitant in changing that .php script.</p>