Page 1 of 1

problem with <?php echo '<p>Hello World</p>'; ?>

PostPosted: 08. November 2010 14:05
by myola2591412a
Hi I know that this post has been covered but there is no solution to find.

I downloaded the .exe for XAMPP Windows 1.7.3 and followed the set instruction.

When finished I had port 80 problem with starting apache on the xampp control panel. My solution was to stop IIS service and I was able to start apache.

I tried the sample php program but it does not work.

Please some one help because I have spent too long looking at web pages without getting an answer
Ola

Re: problem with <?php echo '<p>Hello World</p>'; ?>

PostPosted: 08. November 2010 16:03
by myola2591412a
Hi wole
I checked this and it is sample_.php

Re: problem with <?php echo '<p>Hello World</p>'; ?>

PostPosted: 08. November 2010 17:25
by Altrea
Please describe HOW you open the php file in the Browser

Re: problem with <?php echo '<p>Hello World</p>'; ?>

PostPosted: 08. November 2010 19:04
by myola2591412a
Hi Wole I tried
<?php
echo "<p>Hello World</p>";
?>

On the browser, I am able to open the xampp for windows(xampp 1.7.3) welcome page at "http://localhost/xampp/"

I tried to open the test.php using "http://xampp/htdocs/test.php".

I get Internet Explorer cannot display the webpage

Re: problem with <?php echo '<p>Hello World</p>'; ?>

PostPosted: 08. November 2010 19:23
by Altrea
myola2591412a wrote:I tried to open the test.php using "http://xampp/htdocs/test.php".


That can't work. You have to use the http protocol, there you are right. But you can't just put your full folder structure in there.
Your Webserver have a startdirectory where it starts to look for files on your computer. That folder is called DocumentRoot and is by default the htdocs folder.
The DocumentRoot Folder is automatically mapped to the computers IP. The Webserver listens on port 80 for requests.

localhost is an alias for the computers own Address.

So, if you type in your Browser http://localhost/ your Webserver automatically looks for files in c:\xampp\htdocs.
If you want to request the file test.php inside your htdocs folder the correct URL is http://localhost/test.php

Re: problem with <?php echo '<p>Hello World</p>'; ?>

PostPosted: 09. November 2010 10:56
by myola2591412a
Thanks Altrea and wole