HTML works, php does not.

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

HTML works, php does not.

Postby rayburrell » 18. July 2010 04:15

I have recently downloaded xampp for windows 1.7.3, and installed it on my windows xp machine. xampp seems to be working fine. When I go to http://localhost it takes me to the main xampp page where I can review everything. I can open a html file, but not a php file. Even a simple php file will not load. When I go to open a php page, I get the following error:

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
7/17/2010 10:14:00 PM
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

The php file I have made is simple like this:

<?php
echo "Hello World";
?>

Any help would be appreciated.

Thanks,

Ray
rayburrell
 
Posts: 4
Joined: 17. July 2010 18:22

Re: HTML works, php does not.

Postby Altrea » 18. July 2010 11:12

In which directory do you save this php file?
What URL do you type in do request this page?
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: HTML works, php does not.

Postby rayburrell » 19. July 2010 01:24

I have the file located in the following directory:

D:\programming\Xampp\xampp\htdocs\test.php

I am trying to open it wit the following url:

http://localhost/test.php

I have a html file in the same directory named index.html, and it opens fine with the following url:

http://localhost/index.html

Thanks,

Ed.
rayburrell
 
Posts: 4
Joined: 17. July 2010 18:22

Re: HTML works, php does not.

Postby Nobbie » 19. July 2010 10:39

rayburrell wrote:D:\programming\Xampp\xampp\htdocs\test.php


I think its the standard problem of Notepad and Explorer. If you created the file with Notepad, its actually NOT called test.php but test.php.txt - and Explorer suppresses the *.txt extension as it is configured per default to suppress known file type extensions.

Change the folder settings of Explorer in order to view the real full file name (including all extensions) and you will see, if it is test.php or test.php.txt and rename the file if necessary.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: HTML works, php does not.

Postby rayburrell » 19. July 2010 14:20

I double checked, but unfortunately that's not the problem.

I used programmer's Notepad to write the code, and have looked at explorer as well. My settings do not indicate that it should hide extensions for known file types, and the file type in the menu is .php. Also went to a command prompt and did a directory of htdocs to verify. the test file is .php extension.


Thanks,

Ed.
rayburrell
 
Posts: 4
Joined: 17. July 2010 18:22

Re: HTML works, php does not.

Postby JonB » 19. July 2010 15:55

I have recently downloaded xampp for windows 1.7.3, and installed it on my windows xp machine. xampp seems to be working fine. When I go to http://localhost it takes me to the main xampp page where I can review everything.


If you can dispaly the 'xampp' page - PHP is working (did you also try using the phpinfo() page?). I say this without fear of contradiction, as the 'xampp' page is actually 'http://localhost/xampp/index.php'.

So we are either dealing with a page syntax problem, or a problem with the htdocs folder. By any chance have you added a .htaccess file to the root of htdocs or made changes to the Apache .conf files ??? One more question - where is XAMPP installed on the machine?

:?:

A simple test would be to copy the existing phpinfo.php from the \htdocs\xammp folder into the root \htdocs folder and see if it will execute correctly. If it does; page problem, if it doesn't; folder problem.

:shock:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: HTML works, php does not.

Postby rayburrell » 19. July 2010 17:20

Ok, now I feel really dumb...

It appears that xampp placed the installation on both my C and D drives... :oops:

If I place the file under htdocs on the c drive installation, it works fine. I'm a little confused how it happened, but at least it is working.

Thanks for all the help!

Ed.
rayburrell
 
Posts: 4
Joined: 17. July 2010 18:22


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 96 guests