I can't run my code normally

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

I can't run my code normally

Postby php_newbie » 22. January 2011 17:28

I'm using the latest version of Xampp installer for windows, and I use it on windows 7.
The Apache's service is running normally, but my code can't running in my browser (I try using firefox 3.6 Beta 3 and IE).

This is my code :

Code: Select all
<?php
?>
<HTML>
<HEAD></HEAD>
<BODY>
<?
   echo("Hello word!");
   echo("Hello word!");
?>
</BODY>
</HTML>
<?
?>


I created it under F:\xampp\htdocs\learning01.
I call it in my browser using localhost/learning01, but it shows nothing, just blank.
Can everybody give me a hint ? thanks a lot. I'm sorry for my english.
php_newbie
 
Posts: 1
Joined: 22. January 2011 17:06

Re: I can't run my code normally

Postby Altrea » 22. January 2011 17:42

Does your file have a .php file extension?
Is your Apache really started (green running sign next to Apache in the XAMPP control panel)?
Can you request the XAMPP Backend ( http://localhost/xampp/ )?
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: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: I can't run my code normally

Postby peterwt » 22. January 2011 22:33

Try

Code: Select all
<?php
?>
<HTML>
<HEAD></HEAD>
<BODY>
<?php
   echo("Hello word!");
   echo("Hello word!");
?>
</BODY>
</HTML>
<?php
?>

and the file name should be learning01.php.

But all you need is

Code: Select all
<HTML>
<HEAD></HEAD>
<BODY>
<?php
   echo("Hello word!");
   echo("Hello word!");
?>
</BODY>
</HTML>


Peter
Peter
peterwt
 
Posts: 42
Joined: 17. March 2009 11:06
Operating System: Windows 7 64 bit Professional

Re: I can't run my code normally

Postby manolo34 » 23. January 2011 03:21

I have a similar problem, but in my case I have a file located at htdocs, named "prueba.php"; when I try to run it I type "localhost/prueba.php" and IE returns Not found
Error 404
localhost
22/01/2011 07:54:48 p.m.
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

I am just learning php and installed xampp for windows, so I tried uninstalling xampp and installing it again, but it didn't work.

Any suggestions?
manolo34
 
Posts: 2
Joined: 23. January 2011 03:07

Re: I can't run my code normally

Postby Altrea » 23. January 2011 04:35

Your problem is NOT similar to the original poster.

Which Editor do you use to create your PHP files?
If you use Windows Notepad, be sure your file will be saved as prueba.php and NOT prueba.php.txt.
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: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: I can't run my code normally

Postby manolo34 » 23. January 2011 20:09

I am using Windows Notepad, and checked the extension (which is normally hidden), and you were right!!

I removed the ".txt" and it worked!

Thanks a lot for your support.
manolo34
 
Posts: 2
Joined: 23. January 2011 03:07


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 49 guests