Solved

Change permission of http uploaded file FROM www using PHP chmod function on FreeBSD

Posted on 2008-10-22
4
402 Views
Last Modified: 2013-12-06
Files uploaded via http and moved via a PHP script are currently given the owner www:www.

I need these files to belong to a different user so they count towards their file quota and not toward www's.

I intend to use PHP's chmod function to change the owner but I appreciate that without some changing of privileges on the server this will not be possible.

The server is running FreeBSD. I have root access. What permissions do I need to add/change on the server to allow PHP, running as www, to change the owner of files belonging to www:www?
0
Comment
Question by:mikely
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 6

Expert Comment

by:Twisteddk
ID: 22784769
Offhand, the user/program executing the change need to be a part of the group www and the file must have +w permissions set for the group, then it should work.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 125 total points
ID: 22785004
> I need these files to belong to a different user ..
only root can do a chown (except the OS is configured highly insecure)
0
 
LVL 62

Expert Comment

by:gheist
ID: 22785775
You can make shid directory and use umask 0007 inside php, so you have special group where to add users to write web files.
0
 

Author Closing Comment

by:mikely
ID: 31508997
It wasn't so much a solution as telling me what I was trying wouldn't work but offering no suggestion of how I might otherwise achieve the same affect.
0

Featured Post

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question