Clean install, localhost runs, but won't run new local files

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

Clean install, localhost runs, but won't run new local files

Postby scanreg » 08. September 2006 17:28

Installed 1.5.3a
WinXP

Clean install
Localhost runs default xampp pages fine

I then installed a new dir under htdocs:

/htdocs/fred/index.php

When I go to:

http://localhost/fred/index.php

I get an "Object not found!" error - 404

What's also weird is that I setup the exact same thing on another computer, and it works fine - everything is default.

Any ideas? Many thanks :)
scanreg
 
Posts: 5
Joined: 08. September 2006 17:13

Re: Clean install, localhost runs, but won't run new local f

Postby Izzy » 08. September 2006 23:12

scanreg wrote:Installed 1.5.3a
WinXP

Clean install
Localhost runs default xampp pages fine

I then installed a new dir under htdocs:

/htdocs/fred/index.php

When I go to:

http://localhost/fred/index.php

I get an "Object not found!" error - 404

What's also weird is that I setup the exact same thing on another computer, and it works fine - everything is default.

Any ideas? Many thanks :)
Check your fred directory contains the index.php file as Apache can't find it.
You can check your apache/logs/error.log and your access.log for more clues.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby scanreg » 11. September 2006 13:58

Hi Izzy

I know that the index.php file is there.

What I found is that it has something to do with being within the /public_html/ directory.

When I tried to run things from here:

.../htdocs/abc/public_html/fred/index.php

I got the 404

But, when I pulled it out of public_html, the dang thing worked okay:

.../htdocs/abc/fred/index.php

No lie, that's the only thing I changed. It runs great now. Maybe there's some apache config file that I should check. I dunno.

HTH :)
scanreg
 
Posts: 5
Joined: 08. September 2006 17:13

Postby Izzy » 11. September 2006 23:30

scanreg wrote:Hi Izzy

I know that the index.php file is there.

What I found is that it has something to do with being within the /public_html/ directory.

When I tried to run things from here:

.../htdocs/abc/public_html/fred/index.php

I got the 404

But, when I pulled it out of public_html, the dang thing worked okay:

.../htdocs/abc/fred/index.php

No lie, that's the only thing I changed. It runs great now. Maybe there's some apache config file that I should check. I dunno.

HTH :)
You can drop the public_html folder as it is the default on a Linux server.
The default that corresponds to it in the XAMPP Apache server is htdocs.

Correct paths are very important as the server has no way of knowing them unless you tell it in a configuration file or in the address bar of your browser as you found out.
In your case it had no way of knowing that you used public_html. You did not use it in your address bar. If you had run this:
http://localhost/abc/public_html/fred/index.php
It would have worked also.

Your document root in the httpd.conf file is set to:
xampp/htdocs
by defaults and so looks for web sites under that directory and should remain unchanged so that you can always see the XAMPP Welcome Page with the test items and other configurations like security and password changes and phpMyAdmin etc. by typing in the address bar:
http://localhost

So you can get a better understanding of how Apache does things, look into the docs and, in your case, find the Configuration links and the Virtual Host links. They are fairly easy to follow and are very comprehensive in content.
http://httpd.apache.org/docs/2.2/

and all the directives that can be used and an explanation of each including the directory and virtual host directives can be found here:
http://httpd.apache.org/docs/2.2/mod/core.html

Try experimenting and a golden rule is to always back up the original conf files before editing so it is a simple matter to revert if things go wrong and the server won't start.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: hthnightwolf, JJ_Tagy and 64 guests