[thelist] PHP errors

Matt Warden mwarden at gmail.com
Tue May 16 12:18:03 CDT 2006

On 5/16/06, Richard Brown <rich at cregy.co.uk> wrote:
> Hi Guys
> What does this mean in terms of php errors and do you know how I fix it
> please:
> open_basedir restriction


<quote src="http://php.net/features.safe-mode#ini.open-basedir">
     Limit the files that can be opened by PHP to the specified
directory-tree, including the file itself. This directive is NOT
affected by whether Safe Mode is turned On or Off.

    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.

    The special value . indicates that the working directory of the
script will be used as the base-directory. This is, however, a little
dangerous as the working directory of the script can easily be changed
with chdir().

    In httpd.conf, open_basedir can be turned off (e.g. for some
virtual hosts) the same way as any other configuration directive with
"php_admin_value open_basedir none".

    Under Windows, separate the directories with a semicolon. On all
other systems, separate the directories with a colon. As an Apache
module, open_basedir paths from parent directories are now
automatically inherited.

    The restriction specified with open_basedir is actually a prefix,
not a directory name. This means that "open_basedir = /dir/incl" also
allows access to "/dir/include" and "/dir/incls" if they exist. When
you want to restrict access to only the specified directory, end with
a slash. For example: "open_basedir = /dir/incl/"

        Note: Support for multiple directories was added in 3.0.7.

    The default is to allow all files to be opened.

Matt Warden
Oxford, OH, USA

This email proudly and graciously contributes to entropy.

More information about the thelist mailing list