On November 6, 2002 07:10 pm, Philip Olson wrote: > I get a Segmentation fault with this script using > PHP CLI: > > <?php > headers_sent($file, $line); > ?> > philip@rock:~$ php test.php > Segmentation fault > > That's when no headers are sent before the call. But if > headers are sent beforehand, it works:
The crash has been fixed in the CVS. PHP CLI cannot send any headers because it is not ment for a webserver enviroment. While CGI, is mostly geared towards web servers and by default will try to send headers. Ilia > <?php > print "foo\n"; > headers_sent($file, $line); > print "$file : $line\n"; > ?> > philip@rock:~$ php test.php > foo > test.php : 2 > > With a fairly (a few weeks old) version of PHP CLI. > I am unable to do further tests at this time, in fact, > I am unable to build HEAD (it dies). Only CLI seems > to be affected, CGI works either way. Haven't > tested mod. > > Regards, > Philip Olson > > P.s. If no headers were sent, in CGI, $line gets > the value int 0. $file is an empty string. > > On Wed, 6 Nov 2002, Philip Olson wrote: > > > On Wed, 6 Nov 2002, Wez Furlong wrote: > > > if (headers_sent($file, $line)) { > > > echo "headers were sent by $file:$line"; > > > } > > > > [snip] > > > > Hello Wez- > > > > Ahh, that makes sense. I was a little off > > base on that one! :) Will add an example now. > > > > Regards, > > Philip > > > > > > > > > > -- > > PHP Development Mailing List <http://www.php.net/> > > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php