open_basedir and file uploads I've run across a problem where, when open_basedir is enabled in my php.ini, my file uploads don't work in Drupal. The parent directory is included in the open_basedir list, yet uploads still don't work. I've tested this both on my development server (running Windows Server 2008, IIS7 and PHP 5.3.2) and locally on my pc with XAMPP (running Windows 7 Enterprise, Apache 2.2 and PHP 5.3.5). The results are the same: as soon as open_basedir is disabled, file uploads within Drupal work perfectly.

Here's an example of the error I get:

Warning: move_uploaded_file(): open_basedir restriction in effect.
File(public://field/image/example_1.jpg) is not within the allowed path(s):
(K:\content;L:\content;E:\content;E:\Upload_temp) in file_save_upload() 
(line 1528 of E:\content\includes\file.inc).
File upload error. Could not move uploaded file.


This is what my File System settings are:

Public file system path - sites/default/files/pictures

Temporary directory - sites/default/files/pictures/tmp

Directory structure goes like this: E:\content\drupal. As evidenced, Drupal is within the bounds of open_basedir. What am I missing here?
The warning appears because public://field/image is not included in the list of directories the open_basedir allows. Links are resolved, but an external path like public://field/image is not resolved to an internal path; for example, if the code is trying to read http://example.com/img_png/image.png and img_png is listen by the open_basedir directive, the warning will be shown.