Re: chown() despiration

From: Date: Thu, 23 Jan 2003 16:55:06 +0000
Subject: Re: chown() despiration
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-132863@lists.php.net to get a copy of this message
Urb Lejeune wrote:
    I could do this in perl but I'm being stubborn :-)
When I run the following code as a regular user, everything fails. When I run it as root the directory is created and the chmod works. However, chown reports: chown failed: Operation not permitted
    Here is the code.
$Directory2Create = "/home/e-govdemo/htdocs"; mkdir($Directory2Create,0777); chown($Directory2Create,"egovdemo"); chmod($Directory2Create,0777); "egovdemo" is a legal user name as can be seen from this partial directory listin.
egovdemo nobody       4096 Sep  6 11:29 Logs   
also tried chown($Directory2Create,"egovdemo:nobody"); chown($Directory2Create,"637"); chown($Directory2Create,"637:99");
    To help save my few reamining hairs and could someone with
root privilege try it and see if it's me or PHP? Thanks Urb
It works fine with PHP 4.2.2 from the command line run as root on my Linux system (using a user on my system) produced:
drwxrwxrwx    2 leagas   root         4096 Jan 23 16:43 test
Peter

« previous php.general (#132863) next »