Index.php file not being picked up [SOLVED]

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

Index.php file not being picked up [SOLVED]

Postby geor » 06. November 2011 20:21

I'm running Xampp version 1.7.4 on Windows Vista SP2 with xampp intalled at "C:\xampp".
My understanding was that when I accessed "http://localhost/" that an attempt would be made to load the file index.html or index.php at C:\xampp\htdocs\. However, when I enter "http://localhost/" it actually load the file "http://localhost/xampp/start.php".
Everything seem to be loaded ok and running perfectly well. Could someone confirm if my understanding is correct or if I need to change some settings in one of the files.
Thanks.

PS.
Sorry, I ought to have been more explicit "http://localhost/xampp/start.php" is situated in my system in "C:\xampp\htdocs\xampp\start.php"

G.
geor
 
Posts: 3
Joined: 06. November 2011 19:55
Operating System: Windows Vista

Re: Index.php file not being picked up

Postby Altrea » 06. November 2011 21:23

Hi geor (don't have time for a welcome!?),

geor wrote:My understanding was that when I accessed "http://localhost/" that an attempt would be made to load the file index.html or index.php at C:\xampp\htdocs\.

That's correct.

geor wrote:However, when I enter "http://localhost/" it actually load the file "http://localhost/xampp/start.php".

Thats correct, too.

geor wrote:Could someone confirm if my understanding is correct or if I need to change some settings in one of the files.

Maybe you should take a look into your c:\xampp\htdocs\index.php file. I guess you will understand, what is happening there. If not, we will explain it to you.

best wishes,
Altrea
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: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Index.php file not being picked up

Postby geor » 07. November 2011 22:10

Altrea,
Thank you for your reply and for pointing me in the right direction. I am a complete novice to this and have thrown myself in at the deep-end. To let you understand, I renamed the original "index.html" and replaced it with my own. I had also written a php which I would access from a link in my html. The small php tested ok but I had accessed it directly. I had not altered the "index.php" file.

Your pointer has taught me that the php file takes precedence over the html file as my first test now was to rename the "index.php". That being done my html file was found and loaded. I looked inside the xampp "index.php" and while I have yet to fully appreciate what it is doing I have established that it was redirecting the request to the xampp folder within htdocs. Also it appears that "start.php" must come somewhere within the hierarchy, there being no "index" php or html in the xampp folder.

The remark at the foot of the code in the original "index.php" says "Something is wrong with the xampp installation". I am not sure if there is still something wrong and that I am bypassing it by replacing with my own code. I will study this code further in order to fully undrstand it. I have a couple of PHP and Mysql books on order so things will no doubt come to light fairly soon.

Thanks again for your time.
Geo.
geor
 
Posts: 3
Joined: 06. November 2011 19:55
Operating System: Windows Vista

Re: Index.php file not being picked up

Postby Sharley » 07. November 2011 22:21

Hello Geo,
there being no "index" php or html in the xampp folder.

There is an index.php in the \xampp\htdocs\xampp folder and that is where the index.php in the htdocs folder redirects to.

The index.php in the htdocs\xampp folder loads 3 files in frames (The XAMPP orange Welcome (Admin) page):
head.php
navi.php
start.php

Also loads 2 required files:
lang.tmp (when created after language selection)
splash.php

Best wishes. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Index.php file not being picked up

Postby Altrea » 07. November 2011 22:29

geor wrote:Also it appears that "start.php" must come somewhere within the hierarchy, there being no "index" php or html in the xampp folder.

Thats not correct. Inside that \xampp\htdocs\xampp\ folder is a index.php file which has a frameset. And one of the pages loaded in this frameset is the start.php file.

geor wrote:The remark at the foot of the code in the original "index.php" says "Something is wrong with the xampp installation". I am not sure if there is still something wrong and that I am bypassing it by replacing with my own code.

You don't have to do something. This message will be displayed on your display, if the php block isn't processed correct, so that the redirect don't takes effect.
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: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Index.php file not being picked up

Postby geor » 07. November 2011 23:22

Sharley, Altrea,
Thanks for the additional information. I obviously didn't look hard enough for the index.php file in the xampp folder. You've given me some great pointers here, so I should be able to study those files and follow them through and learn a bit more.
Kind regards,
Geo.
geor
 
Posts: 3
Joined: 06. November 2011 19:55
Operating System: Windows Vista

Re: Index.php file not being picked up

Postby Sharley » 07. November 2011 23:26

Thanks for the feedback Geo. 8)

I think now this topic can be closed.

If you have any more issues then please start a new topic.

Best wishes. :)
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 148 guests