4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: noidguy on November 24, 2002, 02:07:31 AM

Title: open_basedir restriction in effect
Post by: noidguy on November 24, 2002, 02:07:31 AM
I've seen this topic mentioned before, but have never found a simple solution in English.

Here is the error message I get in some of my categories...

Warning: open_basedir restriction in effect.  File is in wrong directory in /home/.decker/"mylastname"/gynoid.dreamhost.com/4images/includes/functions.php on line 366.

Some categories with images get multiple error messages.  The main page is here:    www.gynoid.dreamhost.com/4images

Could someone check it out and give me some tips?  Thanks.
Title: open_basedir restriction in effect
Post by: Jan on November 24, 2002, 10:30:27 AM
Replace
Code: [Select]
$src = (!file_exists($media_src) && file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
with
Code: [Select]
$src = (!@file_exists($media_src) && @file_exists(preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src))) ? preg_replace("/\/{2,}/", "/", get_document_root()."/".$media_src) : $media_src;
in includes/functions.php.

Jan
Title: open_basedir restriction in effect
Post by: noidguy on November 24, 2002, 02:46:52 PM
Thank you, that seems to have done it.   :D
Title: open_basedir restriction in effect
Post by: V@no on November 24, 2002, 05:29:51 PM
Jan, just courious, what @ does? why do u use it at first place if it make some problem?
Title: open_basedir restriction in effect
Post by: Jan on November 24, 2002, 08:40:46 PM
@ in front of function names supresses the error message.

Jan
Title: open_basedir restriction in effect
Post by: V@no on November 24, 2002, 08:45:53 PM
ah! thx!
Title: open_basedir restriction in effect
Post by: V@no on March 24, 2003, 06:09:49 AM
so, basicaly, this is not a fix? its just hides the problem?  :?
Title: open_basedir restriction in effect
Post by: Jan on March 24, 2003, 03:08:43 PM
In most cases yes, in this case no. The script tries to check if the path is relative to the Document Root, no problem if the file is not there.
Newer PHP versions output error messages here, older doesn't.

Jan