PHP not working correctly...

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
rishford
Forum Newbie
Posts: 1
Joined: Wed Oct 10, 2007 10:19 am

PHP not working correctly...

Post by rishford »

Hi Guys

First time in a PHP forum (not to mention using PHP) so bear with me.

I have currently installed Apache Web Server 2.2, MySQL 5.0 and PHP 5.0 (all using windows XP installers) onto my machine. I know that MySql and Apache are both working correctly, so to test that PHP is working also I created a test.php using <? phpinfo(); ?> I have placed it in the htdocs folder so it can be accessed using the url: http://localhost/test.php:

<html>
<body>
<? phpinfo(); ?>
</body>
</html>

I get two results:
IE7 - Blank Page
Firefox - Displays the html source code

Is there anything I have to do to ensure that the PHP code is recognised?

Thanks :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Just so we don't over-complicate this problem, lets just make sure short tags are enabled first.

Code: Select all

<? phpinfo(); ?>
should be

Code: Select all

<?php phpinfo(); ?>
Post Reply