my php files it is not showing any output

Problems with the Windows version of XAMPP, questions, comments, and anything related.

my php files it is not showing any output

Postby sathya M » 25. February 2010 15:19

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.?
sathya M
 
Posts: 1
Joined: 25. February 2010 14:28

Re: my php files it is not showing any output

Postby Altrea » 25. February 2010 16:13

How do you tried to access the php-files and which file extension do they have?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: my php files it is not showing any output

Postby BigWetDog » 25. February 2010 17:02

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?
User avatar
BigWetDog
 
Posts: 148
Joined: 25. February 2010 15:54

Re: my php files it is not showing any output

Postby MC10 » 26. February 2010 07:51

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.
MC10
 
Posts: 148
Joined: 20. February 2010 20:13

Re: my php files it is not showing any output

Postby zaithianknightwolf » 02. March 2010 14:32

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
zaithianknightwolf
 
Posts: 2
Joined: 02. March 2010 14:27

Re: my php files it is not showing any output

Postby Altrea » 02. March 2010 16:50

XAMPP 1.7.2/1.7.3?
Try short_open_tags in the search
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: my php files it is not showing any output

Postby zaithianknightwolf » 02. March 2010 17:56

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
zaithianknightwolf
 
Posts: 2
Joined: 02. March 2010 14:27


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 139 guests