As part of the eriecanalny.com project, I want to use mySql as the database. MySql is a php based database system, apparently. But simple php documents fail in localhost with a 500.21 error. The simple solution was to uninstall/reinstall the Windows feature for IIS CGI. Details below.
As I said, I wanted to start working with MySql, but php was not functioning properly on my Vista Business sp2 machine. I discovered that MySql is already ‘installed’ on my laptop (probably as a result of installing SilverLight) though I’ve never used it.
To check if php is functioning, I created a quick php document, phpinfo.php, containing a single line of code:
<?php phpinfo(); ?>
But when I try to test is in localhost, I get the above 500.21 Internal Server Error Handler such-and-such has a bad module “FastCgiModule” in its module list.
So, after a couple of hours of hunting, here is the solution for my problem: For me, the IIS module ‘fastcgi’ was missing.
- First, figure out if your FastCgiModule is in your IIS.
- Open Internet Information Services Manager
- Select the uppermost Connection (on the left side)
- Double-click the Modules object.Look among the installed modules for ‘FastCgiModule’. For me, it was missing. If your module is there, you can probably stop reading as the rest of this post may not apply to your situation.
- So, my ‘FastCgiModule’ was not installed. Who knows why? To install the missing ‘fastcgi’ module, I only needed to uninstall and then reinstall the Windows feature ‘Internet Information Services -> World Wide Web Services -> Application Development Features -> CGI’. Here’s how I did it:
- Go to Control Panel
- Programs and Functions -> Turn Windows features on or off
- Check if CGI is on or off: ‘Internet Information Services -> World Wide Web Services -> Application Development Features -> CGI’
- That did it for me. I went back into IIS Manager, and checked my Module list again, and this time ‘FastCgiModule’ is listed, and voila, my php pages now work. You may want to also check your Handler Mappings but that would be the subject of another post.