How i can set owner and group to file in php , i write
chgrp("dompdf/background_image.html",1122)开发者_高级运维;
but this is not working
it Set 99 instead of 1122
PHP has a chown function available, however you need the permissions to do so, so you probably have to be root.
There is the change group functio also availbe, this is the one u used.
Examples are available there, you need the appropriate privileges. that is probably your problem.
Take a look at chown and chgrp.
From chgrp:
Only the superuser may change the group of a file arbitrarily; other users may change the group of a file to any group of which that user is a member.
Try shell_exec() http://php.net/manual/en/function.shell-exec.php
<?php
$output = shell_exec('chown ownername:groupname file.php');
?>
精彩评论