Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building a Drupal site which performs various automatic disk operations using the apache user (id=40).

The problem is that the site was set up on a subdomain belonging to user ID 10001 (ie my main FTP account) so the filesystem belongs to that user ID.

So I keep getting errors like this:

warning: move_uploaded_file() [function.move-uploaded-file]: SAFE MODE Restriction in effect. 
The script whose uid is 10001 is not allowed to access /var/www/vhosts/ owned by uid 48 in /var/www/vhosts/ on line 579.

I've tried changing the apache group in httpd.conf to apache:psacln, psacln being the default group for all web users but that's not helped.

The situation now is:

  • ..../files/images/ = 777 and chown = ftplogin:psacln
  • ..../files/images/user = 775 and chown = apache:psacln
  • ..../files/tmp = 777 and chown = ftplogin:psacln

So apparently uid 40 and 10001 both have permissions to write to any of the 3 directories involved, but still can't.

Am i missing something here? Can anyone help?


The solution was simply to set the domain / subdomain up to use apache in CGI-mode rather than straight out of the box mode.


share|improve this question
up vote 1 down vote accepted

What version of Plesk are you using? Perhaps you can change the site to use PHP-CGI for the site, so, any PHP scripts will run as the FTP user. Then, make sure all files in the httpdocs hierarchy are owned by the FTP user. Maybe this will help?

share|improve this answer
Just checked in here after some months and you're right - this was the solution we used! Nice one :) – MrFidge Dec 13 '10 at 17:51
Hi thanks for the feedback, glad to hear that it helped. – Imo Dec 16 '10 at 21:52

I had this problem with Drupal as well.

I solved it by disabling php's safe mode. This can be done through Plesk or manually by editing your httpd.include in the conf directory of the domain you are running drupal, followed by running apache2ctl graceful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.