Page 1 of 1

my php files it is not showing any output

PostPosted: 25. February 2010 15:19
by sathya M
Dear Friends,

I have installed XAMPP successfully with out having any error msgs.
I have started the Apachi and mysql services too in the xampp control panel, both are showing running in green Bg. In Browser I tried to see by typing local host, I am getting all the pages related to XAMPP -- Php myadmin, Phone book, documentation, etc,. Problem is If I load my php files it is not showing any output

<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>

This is the comments I used inside the test.php file. I have saved this file in htdocs folder. Afterwords I have changed the code

<html>
<title> test </title>
<body>
<?php
echo "Hello World";
?>
</body>
</html>

to check whether the file location working. But I have got the title 'test' in my browser. I am new to PHP, please get me the idea to resolve this issue. The output of the echo or print command will visible in the body right.?

Re: my php files it is not showing any output

PostPosted: 25. February 2010 16:13
by Altrea
How do you tried to access the php-files and which file extension do they have?

Re: my php files it is not showing any output

PostPosted: 25. February 2010 17:02
by BigWetDog
Just to be clear,

You've created the file
/XAMPP/htdocs/test.php

which has the following content:

Code: Select all
<html>
<title> test </title>
<body>
<?php
echo "Hello World";
?>
</body>
</html>


When you browse to http://localhost/test.php the titlebar shows "test" but the page is blank.

Is this correct?
Do you know how to "veiw source" from within your browser? If so, what is the output?

Re: my php files it is not showing any output

PostPosted: 26. February 2010 07:51
by MC10
If you're not viewing your files through http://localhost/, and are instead doing so using the direct filename (such as C:\xampp\htdocs\test.php) the file will not run; instead, view it through http://localhost/test.php, as the others above tell you to do.

Re: my php files it is not showing any output

PostPosted: 02. March 2010 14:32
by zaithianknightwolf
Hi there I'm having the exact same problem and even doing a simple
Code: Select all
<? echo "Hello World!"; ?>


I get no outputs. I have it named action.php, trying to use it in conjunction with Flex. I've done this before but I cant get it to work on the computer that Im on. Anyone know what's causing this? Is it something in my php.ini file?

Its just the standard ini file that gets installed into the system, no alterations. All ports are checked and open for XAMPP to use, Apache and MySQL are green and holding, no unusual problems in my apache error log.

Zaithian

Re: my php files it is not showing any output

PostPosted: 02. March 2010 16:50
by Altrea
XAMPP 1.7.2/1.7.3?
Try short_open_tags in the search

Re: my php files it is not showing any output

PostPosted: 02. March 2010 17:56
by zaithianknightwolf
Thanks! It was just by adding <?php that I got it working. For the longest time I didnt use that. Thanks a lot.

Oh and I am using 1.7.3