Re: How to solve include_path / safe_mode / open_basedir /document_root
| From: | Adam Henry | Date: | Thu, 26 Jun 2003 23:18:13 +0000 |
| Subject: | Re: How to solve include_path / safe_mode / open_basedir /document_root | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153042@lists.php.net to get a copy of this message | ||
PHP4: 4.3.2
Likewise, my intention is to restrict the user within
'/home/ahank/public_html' when using fopen(), but allow the user to use
include() on files in '/usr/local/share/wl'. Here is my VirtualHost
config:
php_admin_flag register_globals Off
php_admin_flag safe_mode On
php_admin_flag safe_mode_gid On
php_admin_value include_path /usr/local/share/wl
php_admin_value safe_mode_include_dir /usr/local/share/wl
php_admin_value open_basedir /home/ahank/public_html
However, I get this error when loading a page which includes files in
this shared directory:
Warning: main(): open_basedir restriction in effect.
File(/usr/local/share/wl/hahaha.php) is not
within the allowed path(s): (/home/ahank/public_html) in
/home/ahank/public_html/test.php on line 3
Warning: main(hahaha.php): failed to open stream: Operation not
permitted in /home/ahank/public_html/test.php on line 3
Warning: main(): Failed opening 'hahaha.php' for
inclusion (include_path='/usr/local/share/wl') in
/home/ahank/public_html/test.php on line 3
It would seem that 'safe_mode_include_dir' has nothing to do with
'open_basedir'. Is there an equivalent to 'open_basedir_include_dir'
which will allow one to only interpret files by way of
include/require?
- hank