RES: [PHP] Help on running external command

From: Date: Wed, 20 Feb 2008 14:43:13 +0000
Subject: RES: [PHP] Help on running external command
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-269713@lists.php.net to get a copy of this message
You're using single quotes (') and therefore variables within will not be resolved. try either: exec("su - vpopmail -c \"/var/qmail/bin/maildirmake/home/vpopmail/domains/wwlib.lan/\" . $username"); exec('su - vpopmail -c "/var/qmail/bin/maildirmake/home/vpopmail/domains/wwlib.lan/"' . $username'); try echoing the result before exec'ing: echo('su - vpopmail -c "/var/qmail/bin/maildirmake/home/vpopmail/domains/wwlib.lan/" . $username'); cheers, Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 thiago.pojda@softpartech.com.br Excelência em Softwares Financeiros -----Mensagem original----- De: Mário Gamito [mailto:gamito@gmail.com] Enviada em: quarta-feira, 20 de fevereiro de 2008 11:32 Para: PHP General list Assunto: [PHP] Help on running external command Hi, I need to run an eternal command from a PHP page. My code is: " $username= 'lixo'; $username = 'lixo'; exec('su - vpopmail -c "/var/qmail/bin/maildirmake/home/vpopmail/domains/wwlib.lan/" . $username'); " But I get the error: "/var/qmail/bin/maildirmake/home/vpopmail/domains/wwlib.lan/: Not a directory" Which means that the $username variable isn't being appended to the string. Any help would be appreciated. Warm Regards, Mário Gamito -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#269713) next »