Running mount from PHP
| From: | Mário Gamito | Date: | Wed, 09 Jul 2008 14:04:24 +0000 |
| Subject: | Running mount from PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-276499@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to run /bin/mount and /sbin/mount.cifs from a PHP page.
So, I´ve added this to /etc/sudoers:
-------------------------------------------------------------------------
Cmnd_Alias CMD_MOUNT = /bin/mount
Cmnd_Alias CMD_CIFS ) = /sbin/mount.cifs
nobody ALL = NOPASSWD: CMD_MOUNT
nobody ALL = NOPASSWD: CMD_CIFS
-------------------------------------------------------------------------
Problem is that I need to run it from PHP and in this way, it doesn't mount..
I'm using PHP's exec function:
exec(sudo mount -t cifs ...)
I have the ownership and permissions of the mount point set correctly.
As it is a dynamic application, the mount point always changes
(/mnt/user1, /mnt/user2, etc.), so, /etc/fstab is not an option :(
Any ideas ?
Warm Regards,
Mário Gamito