« Previous Next »

Thread: PHP pages always shown as text

Last post 08-11-2009 9:00 PM by bpolky. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 08-11-2009, 12:00 PM

    • bpolky
    • Not Ranked
    • Joined on 08-11-2009, 11:40 AM
    • Posts 2

    PHP pages always shown as text

    I am a developer who attempting to write my first web based app.  I have been trying to get Vista (service pack 2), IIS 7, PHP, MySQL environment up for two days now and the imprint of the brick wall on my forehead is in danger of becoming permanent.  I have followed the process as described on a number of sites to activate IIS, install PHP and MySQL and then get into the setup process.  I can browse to http://localhost and see the default IIS page, so ISS seems to be running.  I can run php -info in the command prompt so that seems to be there.  I have installed FastCGI and done the the Handler Mapping stuff and made sure that the FastCGI handler is first in the list.  I have double clicked both the php.exe and php-cgi.exe out of frustration and both initially reported an error because ntwdblib.dll was not there, so it has been copied into the PHP folder.   I have uninstalled everything and reinstalled it multiple times and rebooted many many times.

    No matter what I do, whenever I point my browser at a .php file in the wwwroot directory, I simply get the code as text back rather than the PHP created page.

    Can someone save my sanity?

  • 08-11-2009, 3:14 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 661

    Re: PHP pages always shown as text

    Check that your php code does not use short tags. The php tags should be:

    <?php  //some code here  ?>

    and not like this:

    <?  //some code here ?>

    http://ruslany.net
  • 08-11-2009, 9:00 PM In reply to

    • bpolky
    • Not Ranked
    • Joined on 08-11-2009, 11:40 AM
    • Posts 2

    Re: PHP pages always shown as text

    Thanks for the reply, but I had already found that hint on the forums very early in the battle.  I have two test pages on there and the code in them is ....

    <?php phpinfo(); ?>

    and

    <p>This page was created at <b>
    <?php echo date("h:i:s a", time()); ?>
    </b> on the computer running PHP.</p>

    Any other ideas?

    Bruce 

Page 1 of 1 (3 items)
Microsoft Communities