Bug in #! processing - "pear broken on current"

Dag-Erling Smørgrav des at des.no
Fri Jun 10 07:27:27 GMT 2005

Roman Neuhauser <neuhauser at sigpipe.cz> writes:
> The pear people have hacked around the other OS's limitations.
> This change makes FreeBSD lose one small but fine competitive
> advantage over other unix-like systems. Pity.


Here's what pear looks like on Debian:

#!/usr/bin/php4 -Cq
<?php // -*- PHP -*-

SuSE uses a shell wrapper which ends in

exec $PHP -C -q $INCARG -d output_buffering=1 $INCDIR/pearcmd.php "$@"

and pearcmd.php simply starts with


Fedora has a similar shell wrapper:

exec $PHP -C -q $INCARG -d output_buffering=1 $INCDIR/pearcmd.php "$@"

so we're certainly not the only ones who need to modify pear.

Take a look at this:

des at cat ~% uname -a
Linux cat 2.6.8-24.14-default #1 Tue Mar 29 09:27:43 UTC 2005 i686 athlon i386 GNU/Linux
des at cat ~% cat foo.php
#!/usr/bin/php -n -q -dsafe_mode=0 -doutput_buffering=1
<?php print "hello, world!\n" ?>
des at cat ~% php -n -q -dsafe_mode=0 -doutput_buffering=1 foo.php
hello, world!
des at cat ~% ./foo.php
Usage: php [options] [-f] <file> [args...]
       php [options] -r <code> [args...]
       php [options] [-- args...]
  -a               Run interactively
  -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>.
  -h               This help
  -i               PHP information
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -r <code>        Run PHP <code> without using script tags <?..?>
  -s               Display colour syntax highlighted source.
  -v               Version number
  -w               Display source with stripped comments and whitespace.
  -z <file>        Load Zend extension <file>.

  args...          Arguments passed to script. Use -- args when first argument
                   starts with - or script is read from stdin

Dag-Erling Smørgrav - des at des.no

More information about the freebsd-ports mailing list