<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Try running your script with /usr/bin/php5 script.php to test it<br>
Or changing #!/usr/bin/php5 -q
to #!/usr/bin/php -q
<br>
<br>
<br>
Leah Newmark wrote:
<blockquote cite="mid:4A428A41.2070407@capalon.com" type="cite">
<pre wrap="">Thanks.
I didn't change anything in my dialplan. I am aware of reloading configuration :)
My AGIs are copied from a working asterisk install -- the shebang argument is how I've always done it. Either way, I have tried it without the -q as well, and that also didn't succeed.
I just tried your test and it worked fine to run it.
As I said, I know the server is reading the file I've been editing. I see it on the monitor. It's definitely opening the file to return that message...
Any other ideas?
____________________________________________________________________________
On Wed, Jun 24, 2009 at 3:43 PM, Leah Newmark<lnewmark at capalon.com <a class="moz-txt-link-rfc2396E" href="http://lists.digium.com/mailman/listinfo/asterisk-users"><http://lists.digium.com/mailman/listinfo/asterisk-users></a>> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">/ Hi,
</pre>
</blockquote>
<pre wrap=""><!---->/>/
/>/ I'm running asterisk 1.4.22 on a debian server.
/>/ I have php5 installed and it works correctly command line.
/>/ When trying to run a php script via AGI, I get messages such as:
/>/ GI Tx >> I>
/>/ AGI Rx << #!/usr/bin/php5 -q
/>/ AGI Tx >> 510 Invalid or unknown command
/>/
/>/ The scripts are completely executable and owned by asterisk
/>/ -rwxr-xr-x 1 asterisk asterisk
/>/
/>/ Googling is not helping much, and php seems installed perfectly. Other
/>/ servers running the same AGIs have no such problem.
/>/
/>/ I also have noticed odd behavior. When I edit an AGI, the changes aren't
/>/ always showing up in the running of the script via asterisk.
/>/ For example, I tried editing the bash command to read #!/usr/bin/php -q,
/>/ and got the same response on my agi debug.
/>/ I know for a fact it's running the script I've edited:
/>/ Launched AGI Script /var/lib/asterisk/agi-bin/myscript.php
/>/ and it's not in some other directory.
/
Keep in mind that if you change your dialplan to call a different
script you will need to
cli> dialplan reload
Other than that, I'm not sure that it's legal to put an argument into
a shbang, as in your -q when launching php.
It's also possible you've somehow locked down php or directories way
too much. The proper test is to:
bash$ sudo -u asterisk /path/to/script.php
_______________________________________________
-- Bandwidth and Colocation Provided by <a class="moz-txt-link-freetext" href="http://www.api-digital.com">http://www.api-digital.com</a> --
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
<a class="moz-txt-link-freetext" href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
</pre>
</blockquote>
<br>
</body>
</html>