简体   繁体   中英

'nobody' own the file created through php

one of my customers uses a personal server that sets the default owner to 'nobody' so he can't write on or delete any of those files. I have brutally solved this problem manually creating the needed files, but thi sin't a solution because I still need to craeted files with names that I can't forecast.

Is there any php solution or server configuration that I can provide to finally solve this problem?

Some images:

在此处输入图片说明

and

在此处输入图片说明

To get the right permissions, you can set the group setuid bit on the directory with

chmod g+rwxs dirname

This will ensure that files created in the directory are owned by the group. You should then make sure everyone runs with umask 002 or 007.

PHP CHMOD Link

The files get written as the user the web server is running under. in your case nobody is the user that the web server is running

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM