I`m trying to setup a new Drupal 7 install on a Windows 2008 server running IIS7. The drupal install completes with no problems, but after creating a content type with an image field, I`m unable to upload images. I get the following error:

Warning: move_uploaded_file() [function.move-uploaded-file]: open_basedir restriction in effect. File(public://screenshot.png) is not within the allowed path(s): (D:\Hosted Sites\;C:\Windows\Temp;C:\Program Files\PHP\upload) in file_save_upload() (line 1528 of D:\Hosted Sites\domain.com\www\showcase\includes\file.inc).

I host several Drupal 6 sites on the same server and they have no problems. What i've never seen before is this "public://" in the open_basedir path.

The sites/default/files folder is writable. I do have open_basedir set in php.ini with the 3 values in the error message above for security reasons. I've never had a problem with file uploads not working before.


Canadaka’s picture

I upgraded my PHP from an old 5.2.x to the newest 5.3.5 but that did not fix the problem. I know I could fix this by not using the PHP open_basedir, but I want to use it for security. None of my other sites drupal or otherwise have a problem with this.