IIS 7 and Above
IIS 7.5 and PHP
Last post Jan 27, 2018 02:28 PM by JuanMdP
Jan 11, 2018 12:42 PM|JuanMdP|LINK
I'm not sure if this is the right forum, far as I know this isn't related to fastCGI. We recently had to migrate a big app from a regular PC that hosted it to an actual server (Windows Server 2008 R2 with IIS 7.5, PHP was installed using the WebPI) however
in the span of the three weeks that's been running I've noticed a couple of odd issues. Some were related to fastCGI but the latest one has me at a loss~.
In php you define constants so you can use them thorough your project, we are using them to isolate the table names in databases in case of changes in the future; somehow, for some reason, even though the files with the definitions were still being included,
out of nowhere it ceased to acknowledge the value for all defined constants. Restarting IIS "fixed it" but that's not really a fix to a problem I ignore the cause for. So if anyone has any idea what could be going on any kind of insight
into the issue would be greatly appreciated~.
Jan 11, 2018 10:46 PM|JuanMdP|LINK
Further looking into the issue, since it happened again but this time not picking up some other included files, it seems recycling the application pool did the trick. However, given that it's a server with enough resources it seems ridiculous the app would've
depleted the resources in less than 10 hours. Initially the issue was the usual "fastCGI exited unexpectedly" and following some advices on how to configure IIS for PHP is how I wound up with this new issue~.
So I guess the question becomes, what'd an optimal way of setting IIS + PHP + fastCGI in order to avoid having any more of these issues. Clearly the basic stuff I did, the same I had on the old PC, is no longer cutting it with this new server~.
Jan 12, 2018 02:01 AM|lextm|LINK
Check the architecture, and decide where the problem might be,
Otherwise, you probably waste your time on the wrong side.
Jan 12, 2018 06:11 AM|Yuk Ding|LINK
Does it works fine in your develop environment. We need to figure out it occur in IIS side or application side. If it is caused by PHP configuration or code issue. You could consult the PHP related forum.
However, if it could works in the develop environment or other server. Then you could check the steps to host PHP with IIS following this link:
In addition, please ensure you have granted the permission for your authenticated user to access all the file that require to be read.
If your application require load 32-bit, you could enable it in application pool advanced setting.
Jan 12, 2018 12:48 PM|JuanMdP|LINK
Hey Yuk Ding,
Thanks for your reply. It's only happening in production, in my dev environment which is running the same version of PHP and IIS it's just fine. But then again, my dev environment doesn't have any number of concurrent users. The change to this resource depletion
only happened after changing settings on the appPool to No Managed Code for the
.Net framework version and Classic on Managed pipeline mode. I only changed those settings in order to try and fix the issue with "fastCGI exited unexpectedly"; I scheduled the recycling on the appPool
to do it once every 2 hours and that's helped so far but I can't help but think it's not the actual solution since I have yet to figure out why the server runs out of resources in the first place~.
This very same app used to run on a regular PC (W7 + 4 GBs of RAM) and it never experienced either of the issues I mentioned which makes this all the more baffling for me~.
Jan 18, 2018 08:53 AM|Yuk Ding|LINK
Could you find any error code just like this?
The error code may pinpoint the solution.
Jan 27, 2018 02:28 PM|JuanMdP|LINK
Sorry for the long delay, I've been reading a lot, testing a lot, monitoring a lot.. and I'm still having issues. There are two distinctive issues I'm facing:
1. The webserver seemingly runs out of memory and starts failing at loading files. Say, you are including 40 class files in a file, one of them will fail to be included. The rest are loaded just fine, I figured recycling the pool for the app at short intervals
(once every 2 hours) would help but it's happened once ever since~.
2. The infamous "the fastcgi process exited unexpectedly". For that one, which happened very, very recently, I've looked into the event log and this is what I found for the first instance of the error occurring:
Faulting application name: php-cgi.exe, version: 22.214.171.124, time stamp: 0x578fc02c
Faulting module name: kernel32.dll, version: 6.1.7601.23572, time stamp: 0x57fd0378
Exception code: 0xc0000005
Fault offset: 0x00011359
Faulting process id: 0xe18
Faulting application start time: 0x01d39762523e420d
Faulting application path: C:\Program Files (x86)\PHP\v5.5\php-cgi.exe
Faulting module path: C:\Windows\syswow64\kernel32.dll
Report Id: bf320a45-035c-11e8-89e0-842b2b771d30
Are any of those codes the ones you were asking me for? To be honest, I'm going nuts over this; I still can't wrap my head around the fact a regular PC worked more stable with IIS than an actual server is~.