Jump to content

PHP Chmod Problems


Al Brookbanks

Recommended Posts

What group does apache have to be in?

nobody:norgoup on most linux box's

BUT on some it can be anything take suse there it is apache:nogroup

But the admin ( root ) can make it what ever he or she wish's too..

So if you are going to use the CC install script to do this good luck.

Oh and a reg apache install ( Not rpm/deb/exc ) the defualt is apache:apache

If you still need the PHP Command string let me know i will post it in PM or e-mail to you since it can be used to hack a system.

Link to comment
Share on other sites

Guest OskMedia

don't file mangaer scirpts do this in PHP (mine does) so couldnt u implement somehting like that into the installer so it would chomd it at the end of the process seemes possible and quite easy,---------------Josh

Link to comment
Share on other sites

Guest stijnj

found this one..

As far as I can tell, PHP's built in functions will not do a recursive chown or chgrp. But it wouldn't be hard to write a function for this. Here is some starter code based on an example written by John Coggeshall which I found at http://www.coggeshall.org :

<?php

function recurse_chown_chgrp($path2dir, $uid, $gid){

  $dir = new dir($path2dir);

  while(($file = $dir->read()) !== false) {

      if(is_dir($dir->path.$file)) {

          recurse_chown_chgrp($dir->path.$file, $uid, $gid);

      } else {

          chown($file, $uid);

          chgrp($file, $gid);

      }

  }

  $dir->close();

}

?>

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...