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 have a problem with php 5.3.6 using PHP-FPM and file uploads.

My Nginx runs as user nginx PHP-FPM uses pools configured for each vhost. For example a user: test group : test runs one pool.

When the php file uploads to temp file it is owned by user test. After move_uploaded_file is executed by php script it is owned by nginx :/.

I do not know if the change in ownership to web server is the correct behaviour. Is there a way in PHP to change the ownership back to the user I want? (Without going the php chown way as it requires root privileges)

share|improve this question

AFter a fresh day's start and some excessive lat workout I finally sat down to resolve this once again. I found that I had pointed by nginx to the wrong pool. I did it because the session path was giving permission denied errors. this other pool was user 'nginx' default pool. So I fixed the session save path issue by editing php.ini and poiniting it to /tmp. Thats the only way it worked, the default values don;t work on centos. viz /tmp/session for more than one pool. So again back to problem THe new settings witht he right pool works fine.

noob win!

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.