php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #21145 CLI version of PHP always prints HTTP headers.
Submitted: 2002-12-22 12:46 UTC Modified: 2003-01-15 11:41 UTC
From: daeken at hotmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4CVS-2002-12-22 (stable) OS: Linux - Debian Woody
Private report: No CVE-ID: None
 [2002-12-22 12:46 UTC] daeken at hotmail dot com
The CLI version of PHP always prints the headers. This may be related to my configure settings, which follow.


'./configure' '--enable-bcmath' '--enable-pcntl' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-tokenizer' '--with-pear' '--with-curl' '--with-mysql' '--with-gettext' '--with-mcrypt' '--with-mhash' '--with-ming' '--with-ncurses=/root/ncurses-5.3' '--with-shmop' '--enable-sockets' 

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-22 12:48 UTC] derick@php.net
try running "php -v" I bet you're using the CGI.
Not a bug -> bogus.

Derick
 [2002-12-22 12:49 UTC] daeken at hotmail dot com
Just in case I wasn't clear enough on what HTTP headers where printed, they follow:

Content-type: text/html
X-Powered-By: PHP/4.3.0-dev
 [2002-12-22 12:55 UTC] daeken at hotmail dot com
I just reconfigured with --enable-cli and recompiled with the same results. It always says cgi in php -v, no matter if I configure it as a CLI or not.
 [2002-12-22 15:14 UTC] philip@php.net
Please explain to the doc team how to document this new behavior in PHP, regarding the CLI/CGI build process.  And the various problems (such as this ncurses one) that may/will arise.
 [2002-12-22 17:57 UTC] derick@php.net
When you compile both the CGI and CLI (without specifying install paths and without other sapi's) make install will overwrite the installed CLI version with the CGI one (both are installed by default into /usr/local/bin). You can solve this by make install-cli (to overwrite the installed CGI again).
 [2003-01-15 09:43 UTC] shiflett@php.net
So what is the bug here? Does the documentation not mention the -q flag or something?

daeken@hotmail.com, call your CLI/CGI version with the -q flag to suppress headers.
 [2003-01-15 11:41 UTC] philip@php.net
This has been documented.  The user was actually confused between CLI and CGI as only CGI prints HTTP headers.  Simply --enable-cli does not mean PHP will for sure copy sapi/cli/php to {prefix}/bin/php.  Anyway, this is now documented/closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Sep 09 09:01:27 2024 UTC