0

I recently installed PHP on IIS/Windows 7, but it isn't working. I am getting the entire source file in the browser window.

FastCGI Settings shows c:\Program Files (x86)\PHP\php-cgi.exe Handler Mappings has

  • Request Path: *.php
  • Modue: FastCgiModule
  • Executable: C:\Program Files (x86)\PHP\php-cgi.exe
  • Request Restrictions: File or Folder, All verbs, Script Access
3
  • Should be moved to serverfault.com Commented Mar 13, 2010 at 17:56
  • Is PHP installed correctly, does echo phpinfo(); work? Commented Mar 13, 2010 at 18:01
  • If I start the PHP console app and type echo phpinfo();, nothing happens. In fact, no matter what I type nothing happens. Commented Mar 13, 2010 at 18:03

2 Answers 2

6

To answer the answer you gave one hour ago, which said (quoting) :

In some PHP hosts you can being a script block with <?. In IIS the block must start with <?php.


That's not a setting of IIS ; that's a configuration option of PHP, which is called short_open_tag : if that configuration option is enabled, short tags (i.e. <?) will be accepted.

Using short open tags is often not considered as a good pratice, as they can be disabled -- and they are, by default, with recent versions of PHP -- but, if you are admin of your server, you should be able to re-enable them.

And, for information, they are also considered as "bad" because they can cause problem with XML files, which start with <?xml -- if short_open_tag is enabled, this will cause troubles, as it starts with <?


Enabling short_open_tag is just a matter of editing your php.ini file, and using

short_open_tag = On

Instead of

short_open_tag = Off

No need to edit/path all your PHP files ;-)
(Well, if you are admin of your server, that is...)

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the explaination and the warning.
using <?php worked for me, but changing the php.ini did not have the affect described, using PHP 5.3 on IIS 7, anyway.
0

In some PHP hosts you can being a script block with <?. In IIS the block must start with <?php.

Needless to say, I'm going to be spending the resst of the day fixing all the script files I inherited.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.