title: php date.timezone not working correctly for command line script only
body: <p>I have this entry in my php.ini file:</p>
  
  <pre><code>date.timezone = 'Europe/London';
  </code></pre>
  
  <p>But every time i use the DateTime() in a command line script i still get the following error:</p>
  
  <pre><code>Exception: DateTime::__construct(): 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
  </code></pre>
  
  <p>I therefore have to do the following in any scripts to get this to work:</p>
  
  <pre><code>date_default_timezone_set('Europe/London');
  </code></pre>
  
  <p>What else can be causing this error?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I used the following in both command line and web browser:</p>
  
  <pre><code>&lt;?php
  
  var_dump(ini_get('date.timezone'));
  exit;
  </code></pre>
  
  <p>In command line i get:</p>
  
  <pre><code>string(0) ""
  </code></pre>
  
  <p>In web browser i get:</p>
  
  <pre><code>string(13) "Europe/London" 
  </code></pre>