APC on IIS and PHP

I tried installing APC on IIS and this is the result.

"The remote procedure call failed."

That shows whenever I load a PHP file. I checked to make sure TMP was set and made sure IUSR had rights to it.

What could this mean?

Thanks, Jamal

What are the versions of

What are the versions of your software stack (IIS? Windows 2003 Server ?).

On your site entry in IIS, try turn "cache isapi application" on.

Also make sure you have the appropriate version of APC for your version PHP.
APC just like eAccelerator is released for a specific version of PHP.

Let us know how it goes,

I checked the log file, and

I checked the log file, and this is what it has registered for it.


This is the full log
2006-07-20 17:38:54 - W3SVC1 TCG-17 80 GET /index.php Out-of-process+ISAPI+extension+request+failed. 500 1726 0 521 141 HTTP/1.1 localhost Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv: ASPSESSIONIDCCDCDBSS=JEMJJANDIEIABNKMNBGBEGAA -

This might be an IIS identity permission issue...

In IIS try to set the "Application Protection: "Low (IIS Process)"...

When I do that the script

When I do that the script just times out. I get a "The page cannot be displayed." If I open an HTML file it runs fine though.

Hi Jamel,

Hi Jamel,

Sign-up so I do not to approve your messages any more.
I will even have to probably turn off "anonymous posting with approval first" since every day I now get about 10 "spam posts". Man those spammers what a waste of time...

Back to your question.
You probably don't know a tool called "Filemon". This tool is free and enables you to see in real time what is happening at the file system level (file reads/writes...). This is excellent to troubleshoot file permission issues on windows.
Get the tool here:


Then familiarize your self with the tool (about 5 to 10 minutes). To basically learn how to start and stop and clean the logging of file system events.
And if on a busy server or for convenient, learn how to use the filters, to reduce the amount of logging.

Now that you are familiar with FileMon.
Be ready to load your page in your browser (from a different machine if possible or if the same machine try to filter out the browsers activity). Now enable logging in FileMon and load the "faulty page" in your browser.

You should see a bunch of entries in FileMon related to your web page being loaded.
Now look at the "Results" column and search for any line with something like "access denied" or "not found".

Note: Sometimes these entries ("access denied" or "not found") can be intentional.

Most likely "access denied" will indicate a file your system is trying to access but does not adequate permissions. In the "Other" column you might even see the actually impersonated user (like IUSR_ServerName ).
Adjust permissions accordingly.

Now that you know "how to fish" (i.e. how to troubleshoot any permission issue on windows). My guess is that you need to adjust the permissions of your PHP folder. To test this quickly:
1) Set your site under IIS with: Application Protection: "Low (IIS Process)"

2) Give IUSR_Your_Server_Name account full permissions on your PHP folder only (write down the current IUSR_XXXX permissions) make sure you check the option to apply this permission to sub-folders.

3) Try to load your page. If it does not work, you might even want to reboot just in case your got some stuff locked up and try again.

If it works it is a permission issue...you should fine tune the IUSR_BLABLA user permissions to only what is required and nothing more...
In summary:
Most likely the PHP DLLS with Read_Execute
The temp folders (for upload and sessions) with read_write

Let me know how it goes,


Ok, I got it. With Filemon I noticed it was trying to write to C:\tmp and not my TEMP or TMP Env Vars. There was no C:\tmp so I created one, gave it permissions and there it goes.

Thank you so much!


Or not

Maybe not, I tried calling the page again and now... Its timing out :(
Back to testing.

Seems to be workign fine now, maybe IIS had a hickup or something.
I'm going to test it on the production now and see how it runs, hopefully it'll go smoothly.

Hrm... For some reason it

Hrm... For some reason it broke rewrites using the isapi rewrite module. It would just load a blank page whenever a page that was processed through rewrite was loaded.

Glad you learned to use

Glad you learned to use FileMon for permissions problems (very common under Windows with anything from Perl, PHP, ASP, ColdFusion etc.....) This tool saved me 100s of times...

C:\tmp, sounds familiar, might be a default location for some PHP feature ? Don't remember at this time. Check your 2 folder variables in php.ini (one for uploads and one for sessions ). These need Read_Write permissions for the "web user" (i.e usually ISUR_MachineName).

Disable your rewrite ISAPI module for now until you get PHP running 100%.
Once you have PHP 100% working, enable the rewrite module.
Use FileMon to see if it is trying to also write or read some file. Most rewrite modules try to write to a log file. You will probably read_write permissions for the IIS user on that file (something even the folder containing it).

Don't forget on a production system that usually you can decrease the required permissions...

Filemon Time

Hey, sorry about the registration thing. I've had the same guess about the file permissions. I've added IUSR_MACHINENAME to the PHP Directory, C:\Windows\TEMP. And in a desperate attempt also added access to %USERPROFILE%\Local Settings\TEMP which is the temp for my username. I couldn't figure out what it was trying to access but I will try filemon. I was hoping IIS would log what it was trying to access but I couldn't find it. I'll play with Filemon and let you know when I figure something out.

Thanks so much for your input!


I have IIS 5.1

I have IIS 5.1
I'm running PHP 5.1.2, and I downloaded APC for that version. (I actually downloaded the PECL package that comes with the version, which includes APC for that PHP version.)

Also, "Cache ISAPI Application" was on by default. Turning it off doesn't change the results.

Thanks for your quick reply!