# move_uploaded_file open_basedir check warning

- Thread: https://externals.io/message/45878
- Original archive: https://news-web.php.net/php.internals/45878
- Started by daniel@zoltak.com on 2009-10-26T01:25:05+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #45878 — daniel@zoltak.com — 2009-10-26T01:25:05+00:00

URL: https://externals.io/message/45878#45878

Hi,

I have a virtual host setup as follows:

<VirtualHost *:80>
         ServerName www.domain.com
         ServerAlias *.domain.com
         DocumentRoot /home/domain.com
         php_admin_value upload_tmp_dir "/tmp/php_upload"
         php_admin_value open_basedir /home/domain.com/:/usr/local/lib/php
</VirtualHost>

/tmp/php_upload and /home/domain.com and on a different file system.

When performing a file upload the upload is successfully however the  
following warning is displayed:

Warning:  `move_uploaded_file()` [function.move-uploaded-file]:  
open_basedir restriction in effect. File(/tmp/php_upload/phpsrRDr6) is  
not within the allowed path(s): (/home/domain.com/:/usr/local/lib/php)  
in /home/domain.com/upload_do.php on line 15

The setup runs PHP 5.2.10.

As the documentation defines the source path does not need be in  
open_base_dir. The functionality is completing so it appears to being  
abiding by this but the warning message is being displayed.

I believe the issue may reside in the function php_copy_file_ex.

php_copy_file_ex calls the function php_plain_files_stream_opener in  
main/streams/plain_wrapper.c. php_plain_files_stream_opener calls the  
open base check on the source path. It appears for some reason  
STREAM_DISABLE_OPEN_BASEDIR may be being ignored?

Can someone shed some light on this.

Thanks
