Re: Running mount from PHP

From: Date: Wed, 09 Jul 2008 14:32:00 +0000
Subject: Re: Running mount from PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-276500@lists.php.net to get a copy of this message
Mário Gamito wrote: > 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 ? Which user are you running your script with? wwwrun? /Per Jessen, Zürich

« previous php.general (#276500) next »