I setup an NFS mount for the Drupal files directory using the following tutorial and everything seems to work perfectly:
http://www.howtoforge.com/setting-up-an-nfs-server-and-client-on-ubuntu-...
However, the file_prepare_directory() function is not behaving properly and is preventing file uploads to my site. When this function is called, the PHP is_writable() function returns back FALSE when the &$directory parameter is a public stream wrapper (public://...).
This is exactly the line 417 of file.inc that returns false:
$writable = is_writable($directory);
If I make a small modification to use the deprecated drupal_realpath() function to unpack the stream wrapper, then the function returns TRUE as expected:
$writable = is_writable(drupal_realpath($directory));
Does anybody else have the same problem or know a solution?
NFS seems to be a common solution for running Drupal 7 on a cluster, so I can't believe I am the first person to discover this issue!?!?
Comments
I confirm the issue
In our setup a virtual machine with Drupal 7 has the files directory (which is mapped to public:// stream) exposed via NFS4.
Directory permissions are the following
drwxr-xr-x 8 nobody nogroupThe directory is writable by web server user (www-data).
To be noted that in another (older) setup we used NFS3 mapping uid and guid between host server and guest virtual machine, and no issues arose.
It looks like this is an
It looks like this is an ancient known issue: #944582: Check for execute permissions on directories that require file write permissions