HOME  |  AJAX  |  SOLUTIONS  |  TECHNOLOGIES  |  E-COMMERCE  |  ABOUT US
PHP & IIS
PHP tends to be more widely used on the Apache Web Server rather than Internet Information Services (IIS) which usually sees websites written in ASP or ASP.NET, but there is no reason you can't use IIS to serve out PHP pages.  I think there is a view floating around the web that IIS doesn't work as well as Apache for serving out PHP pages, but I think that's more of an issue with a lack of documentation for IIS.

I just ran into an install problem with installing PHP 5 with IIS on a server 2003 box.  I had set everything up, and PHP was working fine, but I couldn't install any of the dynamic extensions, in particular php_mysql.dll

I kept getting the error message:
Unable to load dynamic library 'c:\php\ext\php_mysql.dll' - The specified procedure could not be found.

Which didn't make any since, since that was where the dll was located.  I spent hours mucking with permissions.  I figured that since that is the root of a vast majority of my problems, it was a good bet that it was the root of my problems here as well.  A couple of hours pass, and I'm starting to get real frustrated.  I have no idea why it isn't loading, and I'm about to bang my head through the wall.

So I started from scratch, trying to figure out what I missed.  Ah-ha - I forgot to add the c:\php\ext path to the environment variable.  I forgot about this one because in PHP 4 you don't have to add it.  At least not for the extensions that I have been using.  In PHP 5 you need to add both the PHP directory and the PHP extension directory to the environment path variable.

Ok, path added, everything should be working great. NO! This is not good, I thought for sure that was it.  Now instead of being frustrated, I'm starting to panic.  I'm about to just install PHP 4 because I know that you don't have to load the MySQL extension because it's built in.  I figure that just to be on the safe side, I should reboot the server.  Unfortunally it's not my server, and I haven't worked with a VNC connection before so I don't know if I'll be able to log back on after the reboot.  So I call the server admin, it's late so there is no answer.  So an e-mail goes out.

After a night of panic, I get the server rebooted and it turns out that was the problem.  So here are my suggestions if you are trying to install PHP 5 on IIS and you can't get your extensions to load.

  1. Ensure that you have both the c:\php\ and the c:\php\ext values added to your path environment variable
  2. Make sure your extensions_dir value in the PHP.ini file is set to the correctl location of the extensions directory
  3. Reboot your server to make sure that all of the envrionment variables get reset.

Hopefully someone finds this helpful.  It can be frustrating when things don't work the way you expect.