I have run into a problem similar to this. Basically what I have found is
that there is no way to do this sort of thing using php through apache.
I fixed my problem by writting a perl script that creates the directories
and sets the permissions/groups correctly. I have php write out a text
file and dump it into a directory, the perl script runs from cron and
checks the directory every few minutes and creates the appropriate
directories based on the data in the files. It a hackish way of doing it,
but it actually works quite well. If you didn't want to use cron, you
could just have a process running that monitors the directory constantly.
There are a number of ways to do this, including using cgi php or C or
whatever.
There are very good reasons why you can't do what you want to do, you
just have to get creative.

K E I T H  V A N C E
Software Engineer
n-Link Corporation

On Thu, 22 Mar 2001, Dominique Paquin wrote:

> I posted a message last week on this subject, and I have searched for an
> answer meanwhile.
>
> So i decided to re ask my question a little bit differently since i did not
> find the answer to my problem:
>
> I use a web based application I am making and through this application I
> create directories. I can create the directories with no problem using PHP
> with full rights (777). The directories, then, needs to have their group
> changed to something else and here is my problem,
>
> I tried a chgrp (the php function) from php to change it as well as
> exec('chgrp'...) or exec('chown' ...) and then I tried a system('chgrp'...)
> and system('chown'...). All this to no success. Someone told me, here on the
> list, that apache was runing as nobody:nobody, so it had no rights to change
> rights. We changed the user:group of apache and called it apache:apache.
> then we re-tried all our experiences, to no avail. I am sure I am having all
> the rights necessary because I can delete the directories I create with no
> trouble.
>
> Note: If I connect in console mode with the user apache, i can chown the
> directory as I wish.
>
> Any suggestion on how to change rights on directories would be appreciated.
> (With PHP or any other solution)
>
> Thanks in advance
>
> Dominique Paquin
> Galea secured networks
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to