title: PHP command line error : Timezone database is corrupt
body: <p>My date.php is -</p>
  
  <pre><code>&lt;?php
  echo date('Y');
  </code></pre>
  
  <p>When I execute <code>php -f date.php</code> on my staging machine, I get error -</p>
  
  <pre><code>PHP Fatal error:  date(): Timezone database is corrupt - this should *never* happen! 
  in /home/staging/test/date.php on line 2
  </code></pre>
  
  <p>But when I execute the same on my local / dev machine it works. Although on both staging and local machines, permissions on <code>/etc/localtime</code> and <code>/usr/share/zoneinfo/</code> are the same.</p>
  
  <p>But output of <code>file /etc/localtime</code> vary on both machines.</p>
  
  <p><strong>Local (php5.3.5)</strong> :</p>
  
  <pre><code>/etc/localtime: timezone data, version 2, 4 gmt time flags, 4 std time flags, no leap seconds, 4 transition times, 4 abbreviation chars
  </code></pre>
  
  <p><strong>Staging (php5.3.10)</strong> :</p>
  
  <pre><code>/etc/localtime: timezone data, version 2, 1 gmt time flag, 1 std time flag, no leap seconds, no transition times, 1 abbreviation char
  </code></pre>
  
  <p>While trying to find what the issue is I found <a href="https://stackoverflow.com/questions/8751221/php-timezone-database-is-corrupt-error">this link</a> from SO. I am confused over the accepted answer. <strong>My apache user is not executing the script</strong>.</p>
  
  <p>What seems to be the problem? How do I resolve this issue?</p>