Re: syntax woes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

For any one following this thread, here is how I worked around the apache/php/chown limitation.

script snippet (and if any one has a more elegant style, please share as I am an amateur script kiddie).

$path = "/homes".$username;
$chowncmd = "/usr/bin/sudo /bin/chown ";
mkdir($path);
chmod($path, 0775);
exec($chowncmd.$username. " ".$path);


I modified /etc/sudoers;

#Defaults requiretty   - I added the comment.
apache ALL = NOPASSWD: /bin/chown  - added this line.

- aurf
On Apr 2, 2009, at 6:58 PM, Michael A. Peters wrote:

Chris wrote:
Shawn McKenzie wrote:
Chris wrote:
Wow, it does chown and chmod as well, thats friggen cool.
chown will only work if the script is running as root which I doubt your
drupal site will be.


Or if the script is running as a user/group that has write permissions
to the dir/file that your trying to chown.
chmod may allow that, but not chown.

I believe it depends upon the operating system and version of the operating system.

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



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux