Two scripts, one directory, one works, the other "not f

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

Two scripts, one directory, one works, the other "not f

Postby SmokingMan » 02. January 2008 05:59

I have two scripts in the same directory. One of them works fine, but the other one returns the "Object Not Found" error page. I'm using the correct file name and case in the url. Why would one be "Object Not Found"?

These are very simple scripts as I'm learning and am as new as they come :)

The script that works is a phpinfo() script, and the other is simply the "Hello World" script. The script paths are: "C:/xampp/htdocs/PhpTestScripts/scriptname.php". I use the url: "http://localhost/xampp/scriptname.php" for both scripts.

Why would one script generate the "Object Not Found" message when the other script in the same directory works just fine?

I'm at a loss, any ideas? :?

BTW - I run XP Pro with SP2 if that matters.
No...No, you can't get away...From hells heart I stab at thee...For hates sake I spit my last breath at thee. - Khan Noonien Singh
User avatar
SmokingMan
 
Posts: 9
Joined: 24. February 2007 22:52
Location: Indiana, USA

Postby Izzy » 02. January 2008 06:12

The URI is incorrect for the php file in the PhpTestScripts directory.

The phpinfo.php file is in the xampp directory.

Different directories under the DocumentRoot htdocs directory require differnt URIs.

"C:/xampp/htdocs/PhpTestScripts/scriptname.php". I use the url: "http://localhost/xampp/scriptname.php" for both scripts.


C:/xampp/htdocs/PhpTestScripts/scriptname.php =
http://localhost/PhpTestScripts/scriptname.php

C:/xampp/htdocs/ =
http://localhost/

C:/xampp/htdocs/xampp/phpinfo.php =
http://localhost/xampp/phpinfo.php

Get the idea?
Last edited by Izzy on 02. January 2008 06:18, edited 2 times in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby KallistaAEnvarou » 02. January 2008 06:15

Welcome to the Apache Friends network.

For the file that works, there is most likely a file called:

C:/xampp/htdocs/xampp/scriptname.php

For example, if you were trying phpinfo.php in your PhpTestScripts folder, then there's probably an identical phpinfo.php page in the xampp folder, which is why you're getting the expected code.

Try testing on the link Izzy gave you, since he beat me to it.

If you want to go to your folder without always typing the folder name, see this thread.
KallistaAEnvarou
 
Posts: 126
Joined: 02. December 2007 17:33
Location: Cold Cold California

Postby SmokingMan » 02. January 2008 06:54

I didn't realize there was a phpinfo.php file already under XAMPP. I see now how to access my test scripts. It works now. Like I said, I'm REALLY new to this, so I'm sure I will make several simple mistakes as I learn PHP.

Thanks for your help. I'll try to minimize my noob mistakes and questions as best I can :roll:
No...No, you can't get away...From hells heart I stab at thee...For hates sake I spit my last breath at thee. - Khan Noonien Singh
User avatar
SmokingMan
 
Posts: 9
Joined: 24. February 2007 22:52
Location: Indiana, USA

Postby KallistaAEnvarou » 02. January 2008 06:57

Eh, it's no problem.

If this folder is the only one you're working with, you'd probably be better off checking out this topic versus the one I originally gave. The other one is more useful when you have multiple folders/websites.
KallistaAEnvarou
 
Posts: 126
Joined: 02. December 2007 17:33
Location: Cold Cold California


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 54 guests