Group and owner permissions are invalid when php uploads files

Not sure if this is a problem with configuring php or Linux. The problem I am facing is when the file is uploaded via php using move_uploaded_file () to the directory where the group is installed on ubuntu and the owner is set to www-data, the owner of the downloaded file and group permissions are changed to www-data , which causes problems for my python script to log in and complete its task in the downloaded file.

Example:

move_uploaded_file($tempFile,$targetSAVE);
Catalog

- $ targetSAVE matters:

group: ubuntu
owner: www-data
permissions: 0755

- the owner and group of users downloaded when downloading the php file, at www-data p>

new file changes to:
  group: www-data  <-- need this set to *ubuntu*
  owner: www-data
  permissions: 0755

- python script requires uploaded file group installed in ubuntu

php ubuntu Linux, ?

:     : ubuntu     : ubuntu     : 0755   , , :

group: ubuntu
owner: www-data
permissions: 0755 
+5
3

. , , , .

chown -R ubuntu:www-data /var/www/
chmod -R 775 /var/www/

python script php.

+3

, PHP , -. , - /, , php-.

Apache mod suPHP, , . php- . PHP CGI Apache suEXEC, suPHP.

/, , - .

+1

, chirp PHP script, . http://us.php.net/manual/en/function.chgrp.php

/etc/passwd, "ubuntu".

: " , , ".

0

All Articles