URLs in require_once() not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RandyJohnson
Forum Newbie
Posts: 1
Joined: Sun May 03, 2009 4:47 pm

URLs in require_once() not working

Post by RandyJohnson »

I am having a problem or I am misunderstanding how the URLs work with require_once().

It is my understanding that if the first character of the URL is a '/' then PHP will look for the file starting at the document root.

Is this not correct?

I keep getting file not found errors.

Thanks in advance...

Randy
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: URLs in require_once() not working

Post by requinix »

The manual page for include tells you everything you need to know.

The fact that it doesn't mention filenames beginning with / means they'll be treated like they should be: as absolute filenames. Meaning the root of the filesystem, not the document root.
Post Reply