This is on IIS 6.0. I am a bit confused and wonder if the FastCGI has a problem with the setting the startup directory or if I just have something set up improperly.
When using straight-up PHP 5.2.8 (that is, *.php mapped to php-cgi.exe) if you create a php page with
<?php echo getcwd()."<br />".dirname(__FILE__); ?>
and load it, both functions report the same directory, the folder where the PHP page is located.
If you change IIS to use FastCGI with PHP configured in fcgiext.ini, the getcwd() reports "C:\Progra~1\PHP" while dirname(__FILE__) reports what is expected, the directory where the PHP file is located.
This presents a problem when you have a PHP page (like WordPress) that does a require() expecting a file to be in the same directory as the PHP page, like this:
<?php require('./wp-blog-header.php'); ?>
Under FastCGI, the require files because it is looking for the file in "C:\Progra~1\PHP" ...
My fcgiext.ini looks like this:
[Types]
php=PHP
[PHP]
ExePath=C:\Progra~1\PHP\php-cgi.exe
InstanceMaxRequests=10000
EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000