open_basedir

The open_basedir is if set of limits all file operations to the defined directory and below. This directive makes most sense if used in a per-directory or per-virtualhost web server configuration file. This directive is *NOT* affected by whether Safe Mode is turned On or Off.

Much like Apache's DocumentRoot directive, PHP's open_basedir directive can establish a base directory to which all file operations will be restricted. This prevents users from entering otherwise restricted areas of the server.

For example, suppose all Web material is located within the directory /home/www. To prevent users from viewing and potentially manipulating files like /etc/passwd via a few simple PHP commands, consider setting open_basedir like this:

open_basedir = "/home/www/"

Note : that the influence exercised by this directive is not dependent upon the safe_mode directive.





Content