Forum Moderators: coopster

Message Too Old, No Replies

PHP Error Message!

anyone know why?

         

dreamcatcher

5:50 am on May 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi guys,

A friend of mine keeps getting this error message when she tries to use a PHP program.

Warning: open_basedir restriction in effect. File is in wrong directory in blah blah

Anyone have any idea whats causing this message? I have a feeling I`ve come up against this in the past and it was something to do with Safe Mode being switched on, not sure now.

grahamstewart

6:05 am on May 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yup sounds like there is an open_basdir restriction in effect (which is related to, but not actually part of, Safe Mode).

When a script tries to open a file with, for example, fopen or gzopen, the location of the file is checked. When the file is outside the specified directory-tree, PHP will refuse to open it. All symbolic links are resolved, so it's not possible to avoid this restriction with a symlink.

See chapter 7 of the manual for more details.

toadhall

6:40 am on May 1, 2003 (gmt 0)

10+ Year Member



Also see Chapter 22 [php.net] (Safe Mode).

T

grahamstewart

7:30 am on May 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Err... oops. The online manual must be different from the offline one. Chapter 7 is safemode in my one.

So, yeah, I meant chapter 22. :)

dreamcatcher

6:32 pm on May 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks guys, I figured it was something to do with Safe Mode. I have passed the information and the link on, hopefully she can get the problem sorted out soon.

:)

WibbleWobble

3:25 pm on May 2, 2003 (gmt 0)

10+ Year Member



dreamcatcher said: Warning: open_basedir restriction in effect. File is in wrong directory in blah blah

grahamstewart said: Yup sounds like there is an open_basdir restriction in effect

Nice going, Watson!

;)

dreamcatcher

6:03 pm on May 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nice going, Watson!

LOL!

Anyway with regards to the problem, we seem to have it sorted. In pages that use for instance include("config.php"); if you instead enter the full url to that file, it works fine.

Thought you guys might like to know.

:)

andreasfriedrich

12:47 pm on May 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>if you instead enter the full url to that file, it works fine

No surprise there, since using an URI as the argument to include will perform an http request.

Andreas

grahamstewart

1:18 pm on May 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nice going, Watson!

Sorry perhaps I should have said..

<voice tone="sarcastic">Yup sounds like there is an open_basdir restriction in effect.</voice>

:)