index.php pages won't open in sub-directories

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

index.php pages won't open in sub-directories

Postby pigcity » 03. September 2007 23:25

I have set-up a test version of my web site in the XAMPP environment at C:/xampp/htdocs/mysite/. All .htm* pages, images, etc. work in all directiories and sub-directories except. *.php pages.

Any pages ending in .php only open in a browser if they are in the first level of the directory structure ie: C:/xampp/htdocs/mysite/.

A page such as http://127.0.0.1/mysite/index.php or http://localhost/mysite/index.php will open fine.

A page such as http://127.0.0.1/mysite/level2/index.php or http://localhost/mysite/level2/index.php will not open, instead IE7 and Firefox offer me a pop-up and try to download these files.

This site works correctly at my on-line host, so I'm suspecting this is a configuration problem with XAMPP or PHP, but I am not sure how to correct it. I would appreciate a suggestion. Thank you!
Even a blind pig finds an acorn once in a while.
User avatar
pigcity
 
Posts: 2
Joined: 03. September 2007 22:37
Location: Ohio, USA

Postby Izzy » 04. September 2007 01:10

Is there any info in your apache\logs\error.log ?

I have just tried to reproduce your issue but all work just fine on my server to multiple depths in the mysite structure.

A few things to check:

Do you have a .htaccess file in your mysite directory that might be restrictive?

Does your mysite content require a database set up to operate?

In WINDOWS\system32\drivers\etc\hosts file have you the lines:
127.0.0.1 localhost
127.0.0.1 mysite

IMHO it must be something to do with your mysite directory structure and a sure way to test this out is to go to:
http://localhost
Have the XAMPP Welcome page load and test the various demos as they all require loading php files in subdirectories of the main xampp directory.

A similar scenario to your http://127.0.0.1/mysite/level2/index.php

If that works then XAMPP is as it should be and the need to investigate other options is required.

=================================================
Take a look at the new DeskTopXampp launch control posted by ridgewood:
http://community.apachefriends.org/f/viewtopi ... 967#103967

The DeskTopXampp launch control for XAMPP and XAMPPlite (DTX.exe)
is available here:
http://zedfiles.com/DTX/

I highly recommend DTX.
=================================================
Last edited by Izzy on 04. September 2007 06:19, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby pigcity » 04. September 2007 01:52

Success! Thank you, Izzy!

.htaccess was the culprit, I think. There was a copy in C:/xampp/htdocs/mysite, but it was the copy from my working site at my hosting service (it had a line referring to my host by name). I must have foolishly downloaded it when I copied my other files off their server after I set-up XAMPP. A mistake I'll not repeat! I deleted that copy, restarted XAMPP and .php pages in the subdirectories now work!

Guess I should start some coffee and look to see what other little devils I might have accidentally downloaded from my host's server...
Even a blind pig finds an acorn once in a while.
User avatar
pigcity
 
Posts: 2
Joined: 03. September 2007 22:37
Location: Ohio, USA


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 126 guests