Re: chown() despiration
| From: | Jason Wong | Date: | Thu, 23 Jan 2003 18:22:42 +0000 |
| Subject: | Re: chown() despiration | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132878@lists.php.net to get a copy of this message | ||
On Thursday 23 January 2003 21:49, 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:
[snip]
> To help save my few reamining hairs and could someone with
> root privilege try it and see if it's me or PHP?
Running following as root using 4.3.0 CLI:
<?php
$Directory2Create = "/tmp/htdocs";
mkdir($Directory2Create,0777);
chown($Directory2Create,"jason");
chmod($Directory2Create,0777);
?>
#ls -al /tmp
drwxrwxrwx 2 jason root 4096 Jan 24 02:15 htdocs
> also tried
> chown($Directory2Create,"egovdemo:nobody");
chown() can only change user, use chgrp() to change the group!
> chown($Directory2Create,"637");
Try it without quotes. It works for me.
> chown($Directory2Create,"637:99");
See comment above.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Age and treachery will always overcome youth and skill.
*/