php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2497 header("Connection: keep-alive") has "close" appended?
Submitted: 1999-10-12 04:01 UTC Modified: 2000-07-21 23:00 UTC
From: medavid at ix dot netcom dot com Assigned:
Status: Closed Package: Other
PHP Version: 4.0 Beta 2 OS: Linux 2.2.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: medavid at ix dot netcom dot com
New email:
PHP Version: OS:

 

 [1999-10-12 04:01 UTC] medavid at ix dot netcom dot com
I am running PHP 4.0B2 as a module in Apache (1.3.6) (./configure --with-mysql --enable-track-vars --with-apache=../apache-1.3.6).  The specific distribution is SuSE 6.2.

Here's the problem (I think it's a bug, but I'm not sure; I haven't been able to find any concrete information on this)...  I have a client that calls a PHP script, and specifies "Connection: Keep-Alive" in the GET stream.  This client is using HTTP/1.0.

The PHP script attempts to also keep "keep-alive" turned on by having a "header("Connection: Keep-alive")" at the very top of the script.

However, what gets sent back to the client is "Connection: Keep-alive, close".  It seems that PHP is always closing the connection after the script finishes executing.

I've tested this in various ways.  If I don't invoke a PHP script, the client's keep-alive works and the connection stays active.  

I've noticed that PHP 3 just plain *ignores* the keep-alive; in other words, it *always* inserts a "Connection: close" in the return stream.

Is this the way it's supposed to work?  Shouldn't PHP leave the "Connection:" alone if a script specifies one?

Thanks, and if this isn't a bug, I apologize.

Mark

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-10-14 01:58 UTC] medavid at ix dot netcom dot com
After further investigation, I have found that this is *NOT* a bug in PHP.  It turns out that Apache is appending "close" to the Connection: tag.  Sorry for the false alarm!

Mark

 [1999-10-31 23:37 UTC] rasmus at cvs dot php dot net
Just a thought on this one.  If you send a Content-Length header with your PHP script, Apache will be able to
keep the connection open and maintain keep-alive.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 04:01:36 2025 UTC