[Asterisk-Users] new2agi -php

Doug Harris dogharris at sbcglobal.net
Sat Mar 6 19:11:16 MST 2004


Hi,

Thanks for the insight. I am using PHP 4.2. So I guess code is still good.

There arn't much code there so I played with it. I ran the same code with
only the line
#!/usr/bin/php -q

and it shows me the same error. So I think the script don't even get run. My
php is in /usr/bin so path is correct. I wonder whether there is any
permision or something missing here.

When agi is run by asterisk, does it run as root ?

thanks a bunch.

doug



From: "Derek Bruce" <dbruce at calgarytelecom.com>
To: <asterisk-users at lists.digium.com>
Subject: Re: [Asterisk-Users] new2agi -php
Date: Sat, 6 Mar 2004 16:06:09 -0700
Reply-To: asterisk-users at lists.digium.com
This is a multi-part message in MIME format.
------=_NextPart_000_004E_01C40394.F061F050
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
your code:
#!/usr/bin/php -q
<?php
ob_implicit_flush(true);
set_time_limit(6);
$stdout =3D fopen('php://stdout', 'w');
fwrite($stdout,"STREAM FILE demo-congrats" );
fflush($stdout);
?>
The error message is generated by PHP... If your PHP version is higher =
that v4.3.0
line 5: $stdout =3D fopen('php://stdout', 'w');
should be
$stdout =3D fopen(STDOUT, 'w');
I suspect that is the problem, as everything else looks file.





More information about the asterisk-users mailing list