First PHP Test

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
slipstreamer
Forum Newbie
Posts: 3
Joined: Tue Aug 16, 2011 12:14 am

First PHP Test

Post by slipstreamer »

Hi,

I am a newbie to PHP but not to programming.
I've just downloaded and installed WAMP 2 and I made a basic .php file under
the htdocs directory of Apache which is called test.php and has the following code in it:

Code: Select all

<html>

  <head>
  <title> PHP Test </title>
  </head>

  <body>

  <p> this is an HTML LINE </p>

  <?php
    phpinfo();
  ?>

 </body>

</html>


I don't see any PHP Ingo output. WAMP saysy it is running OK.

Can you help please ?

Thank you,
Colin
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: First PHP Test

Post by Christopher »

What do you see? Is PHP code displayed or does it show nothing where the PHP code is?
(#10850)
slipstreamer
Forum Newbie
Posts: 3
Joined: Tue Aug 16, 2011 12:14 am

Re: First PHP Test

Post by slipstreamer »

It shows

this is an HTML LINE

and nothing else.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: First PHP Test

Post by Christopher »

What if you put only this in a PHP file:

Code: Select all

<?php
phpinfo();
* phpinfo() outputs a full page
(#10850)
Post Reply