I have a custom PHP / MYSQL site running on Windows Server 2016 and IIS. To be honest I don’t know what happened, and what’s still happening. My website just stopped working yesterday afternoon, and I still don’t know why.
It was just showing a white screen with no error message whatsoever. The server was fine, the database was fine, (I was able to RDP in and had no problems using the DB in MYSQL Workbench) the code was exactly the same code running on my dev server and on my second server and those servers never had any issue.
Commenting out the file that connects to the DB allowed me to load the login page (without a DB connection). So I figured there was some code in there that was causing the problem, but eliminating all the code did not solve the problem. Even including this file now entirely blank, resulted in a white screen, but if I did not include it I was able to see the login screen. Eventually I saved the DB connecting file with a different name and included that one instead and it finally gave me a DB connection error instead of a white screen. Exact same code, different name. So then I went into the DB, changed the password and then it worked. I renamed the file to the original name and it still worked. I still don't know why I was getting a connection error and I wondered if maybe somebody had hacked in and changed my DB password, which seems unlikely but changing the password allowed me to connect.
So the main site is usable again, but this morning I’m still having the same issue with my mobile site and my demo site, but the same trick is not working for these sites. As long as I comment out the code that tries to hit the database the page will load, except of course I can’t get any data from the database. If I allow it to try to hit the database I just get a white screen. My admin site, which also hits the same database (and on the same server) never had any issue and that is still working fine.
I’ve never seen anything like this. It makes absolutely no sense. It can't be a code issue because the code works fine on other servers, and the same code is now working on my main site even though that same code was not working yesterday. It can't be a DB issue because I can connect to the DB either through MySQL Workbench or through my dev site or my admin site and my second server.
I've restarted the website multiple times, recycled the application pools. I even rebooted the box entirely. If anybody's ever seen anything like this I would love some insight. I'm desperate now because this site is how I make my living and if my customers can't access it, I'll lose them all.
Vincent.