Saturday, February 28, 2009

PHP IIS and Windows XP

After installing php-5.2.9-win32-installer.msi on Windows XP Pro version 2002 Service Pack 3, I found a basic PHP script could not be interpreted via IIS.

To fix, you need to add a file extension mapping:

Right click on your Default Web Site,
Choose the Home Directory tab,
Choose the Configuration button under Application Settings,
Choose the Mappings tab, and
add an extension mapping where the executable is "C:\PHP\php5isapi.dll" (or your installation directory) and the extension is ".php"

Another issue you will have is debugging information will not be presented users by default. This is generally a good thing, but for development purposes you may want some feedback behind your failed scripts.

Find your php.ini file, normally in your installation folder.
Search for display_errors = off and change to display_errors = on.
Restart IIS via Start | Run | CMD | iisreset and you should be returned debug info in your browser.

No comments:

Post a Comment