[Asterisk-Users] new2agi -php

Doug Harris dogharris at sbcglobal.net
Mon Mar 8 00:43:33 MST 2004


Hi Philipp,

It seems like line #!/usr/local/bin/php -q  cretes the error.

I have this file test.php

#!/usr/local/bin/php -q
<?php
echo "hello world";
?>

And when I run this from command line, I get this error;
"Error in argument 1, char 3: option not found"

[root at asterisk agi-bin]# ./test.php
Error in argument 1, char 3: option not found
Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>]
       php <file> [args...]
  -a               Run interactively
  -C               Do not chdir to the script's directory
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -f <file>        Parse <file>.  Implies `-q'
  -h               This help
  -i               PHP information
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -q               Quiet-mode.  Suppress HTTP Header output.
  -s               Display colour syntax highlighted source.
  -v               Version number
  -w               Display source with stripped comments and whitespace.
  -z <file>        Load Zend extension <file>.
[root at asterisk agi-bin]#

I upgraded my PHP to version 4.3.4, still the same result.

[root at asterisk agi-bin]# /usr/local/bin/php -v
PHP 4.3.4 (cgi) (built: Mar  7 2004 14:39:01)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

When I change the first line to #!/usr/local/bin/php -c, it will run the
test.php but result comes with HTML headers.

I am sure this is not an issue with asterisk, I guess I have to post this to
a php forum :). Anyway I just want to close the loop.

Thanks for help here.

Doug


> -----Original Message-----
> From: Philipp von Klitzing
> [mailto:klitzing at pool.informatik.rwth-aachen.de]
> Sent: Sunday, March 07, 2004 4:17 AM
> To: Doug Harris
> Subject: Re: [Asterisk-Users] new2agi -php
>
>
> Hi there,
>
> also read this:
> http://home.cogeco.ca/~camstuff/agi.html#STREAMFILE
>
> Cheers, Philipp
>
>





More information about the asterisk-users mailing list