tags:

views:

86

answers:

3

Hi All,

In my code, I have included some files for use. When I specify the absolute path, I get a "Forbidden" message.

However, when I use the relative path, the code works.

I wonder why the absolute path was not being accepted.

Can someone explain what is going on?

Thanks in advance!

A: 

If you are on a shared host, they can restrict you not to reach other than your content, so absolute paths can cause troubles.

galambalazs
Not really: Absolute paths are fine as long as they are inside the allowed path(s).
Pekka
In some security configurations this is not allowed. That said, some applications do really silly stuff like `/var/www/appdir$ cd ../appdir/foo`
Imre L
A: 

It might be that the account under which PHP runs doesn't have access to some portion of the absolute path.

E.g. if your absolute path is /home/user/site/pages and the account doesn't have access to '/home/user', you would see this.

denrk
that's almost exactly what i said and got a -1... lol :)
galambalazs
A: 

To save yourself from trouble, always use absolute one.
As for your case, it's easy. You're just using a wrong path. Most likely you messed up a web root with filesystem root.

Col. Shrapnel