[asterisk-users] Unable to run asterisk CLI commands from php

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sat May 9 00:07:15 CDT 2009


On Sat, May 09, 2009 at 10:17:27AM +0530, Sam Hawkin wrote:
> Hi All,
> 
> I am trying to run the asterisk CLI commands from php.
> Some thing like "asterisk -rx reload".
> But it is not working, where as when I try to run
> linux "ls" command it works fine.
> 
> below is sample php code which I am trying to run.
> 
> $command = "sudo asterisk -rx reload";
> 
> $value1 = system($command,$retval1);
> $value2 = exec($command,$retval2);
> 
> echo $value1;
> echo $value2;
> 
> can any one suggest what might be the problem and possible solution to it.

Yes. What error do you actually get? You need to get stderr from hte
command as well for that.

What version of Asterisk do you use, BTW?

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list