Hello,
I have recently switched to a Virtual Server and I'm running into file and folders permissions problems,
First of all, Drupal doesn't seem to be able to generate files, such as the compacted CSS and JS files. When I try to upload files it fails as well.
I'm also getting error messages such as: tempnam() [function.tempnam]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s)
and fopen() warnings.
Finally, when I go into the file system settings, I get:
* The directory sites/default/files is not writable
* The directory sites/default/files/tmp is not writable
These two folders are set as 775. The two messages disappear if I set the permissions to 777, but I never had to do that in shared hosting.
Not sure what's going on here but it looks like I have to set something on the virtual server.
Any advice would be greatly appreciated.
Comments
I just got the
I just got the following:
warning: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid is 10012 is not allowed to access
It sounds like PHP's Safe
It sounds like PHP's Safe Mode is set to ON. I've had the same problem on shared hosting with Safe Mode turned On.
Is it the safe mode too that
Is it the safe mode too that would create these errors when the /files/ and /files/tmp directory permissions are set 775?
It tells me it's not writable when the permissions are set at 775, but works at 777.
Found out the safe mode for
Found out the safe mode for PHP was on. The directories are still not writable, however.
Try removing the directories
Try removing the directories and letting Drupal/Modules recreate them. You may need to take ownership of the directories before you're able to remove them.
Thanks, I've tried that, and
Thanks,
I've tried that, and the directories don't get recreated when I reload the file system settings page, all I get is that the directories files and tmp don't exist.
It looks like something is preventing Drupal from writing files and folders on the website.
Have you tried recreating the
Have you tried recreating the directories manually?
Yes, many times, and if i set
Yes, many times, and if i set the permissions to 777 it will work, but as soon as I set them as 775 the folders are not usable by Drupal.
Could there be a setting from
Could there be a setting from the Virtual Server preventing the creation of files and folders when the permissions are set as 775?
I figured one more thing
I figured one more thing while browsing through the FTP Manager of the virtual. I noticed that after setting the /files/ directory at 777, Drupal was able to create a /CSS/ and /js/ directory in the /files directory. These two dirs are set with 775 and they work.
The reason they work is that they have the user Apache and group Apache while the ones I have created have the website user and group.
Now the question is how to switch to Apache for the Files and TMP directories.