Actualy, you can use chgrp(), but apache must be a member of the group you are changing to.

Jason Wong wrote:

On Friday 25 October 2002 06:51, Matias Silva wrote:

Hi-ya all, here's a quickie.......

In my script I create a directory (mysql.backup.timestamp/) within a
directory called backup/.
I use the function mkdir("mysql.backup.timestamp", "0777"); and it shows
the permissions
as after the function executes:

dr----x--t 2 nobody daemon 1024 Oct 24 15:16
mysql.backup.October-24-2002-1516

Where's the permissions (dr----x--t 2 nobody daemon) coming from? Is
it the php.ini, apache conf or
the operating system?

The permissions (r----x--t) is coming from your mode setting in your mkdir() function AND from the system setting umask -- see manual -> umask() and check out user comments as well.


I would like to set the owner to "root" and the group to "nc". How can
this be achieved
by the php script? Or do I have set this up in the other environments (OS
or Apache)?

You can't.

The user:group comes from the user running the webserver, which in your case is nobody:daemon.

Only root can the the user:group ownership of files and directories. So unless your webserver is running as root you cannot use chown()/chgrp().




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to