title: PHP $_SERVER['SCRIPT_NAME'] is wrong when loading PHP via mod_fcgid
body: <p>I'm using Apache 2.4.7 and PHP 5.5.7.</p>
  
  <p>I have a <code>test.php</code> file in <code>C:\web\vhosts\Symfony\web</code>.</p>
  
  <p>The value of <code>$_SERVER['SCRIPT_FILENAME']</code> is correct:</p>
  
  <pre><code>C:/web/vhosts/Symfony/web/test.php
  </code></pre>
  
  <p>However the value of <code>$_SERVER['SCRIPT_NAME']</code> depends on how I load PHP:</p>
  
  <hr>
  
  <p><strong>If I load PHP as an Apache module</strong>, the value of <code>$_SERVER['SCRIPT_NAME']</code> is:</p>
  
  <pre><code>/test.php
  </code></pre>
  
  <p>I'm a bit surprised that it isn't the same as <code>SCRIPT_FILENAME</code>, but at least it's a correct value, I guess.</p>
  
  <p>Here's how I loaded PHP:</p>
  
  <pre><code>LoadModule php5_module "C:/web/php-5.5.7-Win32-VC11-x86/php5apache2_4.dll"
  AddHandler application/x-httpd-php .php 
  PHPIniDir "C:/web/php-5.5.7-Win32-VC11-x86"
  </code></pre>
  
  <hr>
  
  <p><strong>If I load PHP using mod_fcgid</strong>, the value of <code>$_SERVER['SCRIPT_NAME']</code> is:</p>
  
  <pre><code>C:/test.php
  </code></pre>
  
  <p>Which is just wrong...</p>
  
  <p>Here's how I loaded PHP (based on <a href="http://www.apachelounge.com/viewtopic.php?t=2394" rel="nofollow">a tutorial from ApacheLounge</a>):</p>
  
  <pre><code>LoadModule fcgid_module modules/mod_fcgid.so 
  
  &lt;IfModule fcgid_module&gt; 
     FcgidIOTimeout 40 
     FcgidConnectTimeout 10 
  
     FcgidMaxProcesses 300 
     FcgidMaxProcessesPerClass 300 
  
     FcgidOutputBufferSize 64 
     ProcessLifeTime 0 
     FcgidMaxRequestsPerProcess 0 
     FcgidMinProcessesPerClass 0 
     FcgidFixPathinfo 1 
     FcgidProcessLifeTime 0 
     FcgidZombieScanInterval 20 
     FcgidMaxRequestLen 536870912 
     FcgidIOTimeout 120 
     FcgidTimeScore 3 
  
     FcgidPassHeader Authorization 
  
     FcgidInitialEnv PHPRC "C:\\web\\php-5.5.7-Win32-VC11-x86" 
     FcgidInitialEnv PATH "C:\\web\\php-5.5.7-Win32-VC11-x86;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;" 
     FcgidInitialEnv SystemRoot "C:\\Windows" 
     FcgidInitialEnv SystemDrive "C:" 
     FcgidInitialEnv TEMP "C:\\WINDOWS\\TEMP" 
     FcgidInitialEnv TMP "C:\\WINDOWS\\TEMP" 
     FcgidInitialEnv windir "C:\\WINDOWS" 
     &lt;Files ~ "\.php$"&gt; 
        Options Indexes FollowSymLinks ExecCGI 
        AddHandler fcgid-script .php 
        FcgidWrapper "C:/web/php-5.5.7-Win32-VC11-x86/php-cgi.exe" .php 
     &lt;/Files&gt; 
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>What's wrong with this setup?</p>