I have been trying to find advice on troubleshooting this issue for while but have been unable to find anything which relates to my situation.
I am running PHP 5.6.0 on a brand new Windows 2012 R2 VPS. My PHP App was originally on another 2012 VPS and ran absolutely fine with 128 memory limit set. I have simply copied over my MySQL database and code to this new VPS, and I am now getting the "Allowed memory size of (whatever) bytes exhausted" error. It doesn't matter what I set the limit to, and if I set it to -1 it just eats everything and still errors.
Literally everything I can find online regarding this error either says to up the memory limit, or use some debugging tools that are only applicable to LAMP stacks. No one seems to have had this problem using PHP on windows.
How do I go about debugging what is causing this, clearly my app hasn't changed from copying it from the old VPS, so it must be the PHP setup on this new box, but I can't for the life of me figure it out.
I have tried older PHP versions from 5.3.28 to 5.4.24. I have also checked out my code around the lines it errors at, but there is never anything relevant there, and sometimes the line is just a comment.
If I open Task Manager and then load my site, I can see "CGI / FastCGI (32bit)" memory usage shoot up really quickly until it reaches whatever the limit is then my page errors.
Any advice very welcome.
Thanks
There are a few windows tools that can help a lot here. One is a download, the only link I could find in short order is from CNET so I think you can trust it, it is a Microsoft program called PROCMAN (or Process Manager) ProcMan
The other tool is the Resource Monitor built into Task Manager in Server 2012, it is much improved over Server 2008 and provides a detailed look at what is happening on the server, including memory usage.