I have Windows 2008 Server with IIS, PHP, MySQL installed on it and there are several PHP websites working fine. But when I try to open one of my websites in a browser it shows the source code of page instead of executing the PHP code.
I thought that this is related to the MySQL database connection at first, but when I installed Vs.Php
for Visual Studio 2010 and tried to open my website, it worked.
I think it may be related with IIS settings. By the way test.php
works fine.
Any idea?
Best Answer
I had the same problem with some of my sites on my Debian Squeeze server after I upgraded to a newer version of PHP.
The problem was that the PHP pages that weren't loading were using the PHP short form
<? ?>
and I didn't haveshort_open_tag
enabled in myphp.ini
file.If the
short_open_tag
isn't enabled, one must use<?php
instead.Solutions:
short_open_tag
option in yourphp.ini
file. More on that can be found HERE.<?php
open tag instead of<?
. If using XML in conjunction with PHP, this is the best solution, as PHP short tags conflict with XML.