Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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/domain.com/httpdocs/sites/default/files/images/user owned by uid 48 in /var/www/vhosts/domain.com/httpdocs/includes/file.inc 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?

EDIT

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

Thanks!

share|improve this question

2 Answers 2

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

 
discard

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.