Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have got a number of scripts being moved from an Apache server to an IIS server. Many of these scripts assume that the current working directory of the script is the same as the directory containing the primary (?) scipt file being run. On the IIS server this seems to not be the case, with the working directory always being the PHP directory (e.g. C:\PHP).

Is there some way to change this and make IIS or the FastCGI module use the scripts directory?

I also tried putting a "chdir(dirname(__FILE__))" at the start of the scripts, but apperently that idea is not allowed, with chdir("C:\MySite") failing ("No such file or directory (errno 2)") while "C:\" or "C:\MySite\subdir\" seem to work...

share|improve this question

1 Answer 1

You could try moving the PHP executable into the same directory as the scripts? (It doesn't sound awesome to me, but then I can't think of another solution if it's not possible to specify a working directory otherwise).

If you do that, I think you'll also need to update your Web Service Extensions list to reflect the new location.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.