PHP script loads only from under xamp/htdocs- need other

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

PHP script loads only from under xamp/htdocs- need other

Postby tj0161 » 06. July 2009 07:20

Hello,
I have different PHP pages on different topics. I need to keep them separately in designated folders. The problem is when I test those pages, the browser loads them only if they are in c:/xampp/htdocs. If I create a subfolder inside "htdocs" the PHP script does not load, browser returns an ERROR that could not find the page.
Does anybody know how to fix it?
:o
I have windows only.
thank you in advance.
tj0161
 
Posts: 4
Joined: 06. July 2009 07:03

Re: PHP script loads only from under xamp/htdocs- need other

Postby glitzi85 » 06. July 2009 07:27

http://localhost refers to C:\xampp\htdocs

Assuming you created a file test.php in C:\xampp\htdocs\mytestfolder then you would need to call http://localhost/mytestfolder/test.php

If you still get errors please post the exact location of the file and the exact URI you are trying to open.

glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: PHP script loads only from under xamp/htdocs- need other

Postby tj0161 » 06. July 2009 18:42

Thank you for advice.

My directory structure is:
C:/xampp/htdocs/sitefolder/site1/test.php

When I give an exact path it does not load the test.php it gives me an ERR "object not found"

What could be a reason for an exact PATH not to work?
I did not try yet default link as you advised, However, the one I had working was c://localhos/xampp/ and this works only for those PHP files that are located directly in "htdocs" which is a child of "xampp".

Any comments?
Thanks
tj0161
 
Posts: 4
Joined: 06. July 2009 07:03

Re: PHP script loads only from under xamp/htdocs- need other

Postby tj0161 » 06. July 2009 18:43

tj0161
 
Posts: 4
Joined: 06. July 2009 07:03

Re: PHP script loads only from under xamp/htdocs- need other

Postby tj0161 » 07. July 2009 01:29

OK,
It works finally !!! :D
As glitzi85 advised just to refer as localhost/mysitedir/whatever.php

Previously I was just adding remaining portion of path to localhost/xampp/.....whatever and it did not work, however it work for those that were in "htdocs".
when I check "localhost" via browser it gives default to "localhost/xampp/ " so I assumed that I had to follow the same reference.

Ouppss, a kind silly of me :)
Thank you glitzi85 !!!
tj0161
 
Posts: 4
Joined: 06. July 2009 07:03


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 79 guests