Page 1 of 1

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

PostPosted: 02. January 2008 05:59
by SmokingMan
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.

PostPosted: 02. January 2008 06:12
by Izzy
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?

PostPosted: 02. January 2008 06:15
by KallistaAEnvarou
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.

PostPosted: 02. January 2008 06:54
by SmokingMan
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:

PostPosted: 02. January 2008 06:57
by KallistaAEnvarou
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.