Solved

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

Posted on 2008-10-22
4
396 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
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 61

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now