In the /var/log/secure i can see "sudo: apache : sorry, you must have a tty to run sudo; TTY:unknown...." So, i edit line and comment in visudo to next ### Default requiretty And, eureka, work fine from a web page Thanks all ---------------------------- Mensaje original ---------------------------- Asunto: Start/Stop Service from program php De: opc@xxxxxxxxxxx Fecha: Sab, 26 de Julio de 2008, 11:02 pm Para: php-general@xxxxxxxxxxxxx -------------------------------------------------------------------------- Hi I try execute unsucesfull the next code from web page <?php $cmd1 = shell_exec ("sudo /sbin/service named stop"); echo "$cmd1"; ?> I need write a script execute some command, but try start or stop service like named, network this don't work I edit visudo and add the next lines User_Alias MYGROUP = apache, xyz Cmnd_Alias MYCOMMAND = /sbin/service %MYGROUP ALL = MYCOMMAND %MYGROUP ALL=(ALL) NOPASSWD: ALL But don't work. Suggest? Thanks ... +--------------------- Ing. Oswaldo Peñaloza C. EMPSETEL CIA. LTDA. - ORENSES.COM Proveedor Autorizado de Servicios de Internet Recaudación y Ventas: 9 de Mayo # 2011 e/ Bolívar y Pichincha Tlf. 07-2923-958 Nodo: 5ta Norte # 509 e/ Buenavista y Colón Tlf. 07-2922-396 Soporte Técnico: 093-310-310 Machala - Ecuador -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php