title: JavaScript not working - apache2 + Ubuntu
body: <p>Setup: Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.7 with Suhosin-Patch configured</p>
  
  <p>/etc/debian_version shows "squeeze/sid".</p>
  
  <p>Copied a javascript ts_picker.js file to /usr/lib/cgi-bin (the configured CGI directory in apache conf files). All my PHP programs are in the same directory as well.</p>
  
  <p>Tried running a simple PHP script which refers the ts_picker.js file within a <code>&lt;script src&gt;</code> tag in the <code>&lt;HEAD&gt;</code>.</p>
  
  <p>But no javascript works. Apache error.log shows:</p>
  
  <pre><code>[Wed Apr 13 19:05:41 2011] [error] [client 10.0.0.37] (8)Exec format error: exec of '/usr/lib/cgi-bin/ts_picker.js' failed, referer: http://10.0.27.200/cgi-bin/js.php
  [Wed Apr 13 19:05:41 2011] [error] [client 10.0.0.37] Premature end of script headers: ts_picker.js, referer: http://10.0.27.200/cgi-bin/js.php
  </code></pre>
  
  <p>Tried checking for permissions on the .js: they are 755, just as with all my PHP scripts.</p>
  
  <p>Tried grepping 'javascript' and 'js' recursively under /etc/apache2 and found nothing except a DEFLATE entry:</p>
  
  <pre><code>/etc/apache2/mods-available/deflate.conf:          # AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
  /etc/apache2/mods-enabled/deflate.conf:          # AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
  </code></pre>
  
  <p>Additionally, if I open the source of the PHP's HTML output on the browser and if I click on the ts_picker.js link there, it shows a 500 Internal error.</p>
  
  <p>I am really stuck at this point and unable to do much. Any help is much appreciated. Thanks in advance.</p>