Installing PHP on Windows: if PHP pages work but phpinfo is blank?
August 25, 2011
IIS Management | PHP | Troubleshooting

When installing PHP on IIS, I ran into this: in general, php files worked, but phpinfo.php files were not. They were blank when browsed.

Ads by Google

Posted by ellen at August 25, 2011 03:11 PM

The problem was I had left out the "php" in the opening tag:


where I should have used:

<? php

The first example will work only if short tags are enabled in configuration file. There are reasons NOT to use this, as described in the comments in a standard php.ini file:

; Allow the <? tag.  Otherwise, only <?php and <script> tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On

Ads by Google

Ads by Google

 RSS   |   Contact Me

Ads by Google