I'm going to answer my own question here, but I thought this might be important enough to post so that it would be indexed for the next person who runs into my situation.

Problem: I can not seem to get PHP code to execute on a x64 bit version ofIIS7, whether it be in my desktop, Windows 7, or the application's final destination on Windows Server 2008. Every time I try and look at a test php document to confirm installation, I only see the source code.

I've followed the documentation from PHP, from iis.net, blogs, howtos, just about anywhere I can find that Google would send me. I tried the web installer, tried manual installations instead of the MSI, tried version 5.3.5, tried version 5.2.17, but no matter what, the code would never execute. I even tried registering .eric files with PHP FastCGI Module, but same result, php source code only.


After about an hour or two a day for 5 days trying to figure this out, I started walking through the php.ini file.

Being a usual LAMP user, I always coded <? // phpcode // ?> . Always worked after a fresh install on LAMP.

With IIS/Windows installer of PHP, <? (short tags) is turned off to avoid conflicts with ASP.

Once I added <?php //phpcode ?>, everything worked!

  • Thank you for posting the answer. Being try to find a solution for a good few hours. All works now! – user73968 Mar 10 '11 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.