News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DotVoid.com:
PHP streams and http 1.1 gotcha
March 23, 2006 @ 06:52:50

If you work with streams in PHP, Dotvoid has a tip that just might come in handy some day in the future. The tip deals with the difference between HTTP 1.1 and 1.0.

I have a class that I wrote some time ago that is called URLImporter. It's simple, does what it is supposed to do and thus makes my life easier. Essentially it helps me fetch URL resources - mostly dynamically generated data from password protected extranets that require me to use HTTP POST.

Up until recently this class have only been used behind an http proxy. The other day I moved it to another machine - that is not behind a proxy and suddenly it stopped working.

He realized the problem after a bit of research - HTTP 1.1 automatically performs a "keep alive" on the connection, not timing out after the transaction's done like 1.0 does. His solution? Passing another HTTP header to the stream connection: "Connection: close".

0 comments voice your opinion now!
streams gotcha 1.1 1.0 difference keep-alive close streams gotcha 1.1 1.0 difference keep-alive close


blog comments powered by Disqus

Similar Posts

Community News: Zoop PHP Framework 1.1 Released

Zend Developer Zone: Why Should I Care What Server My Application is Running On?

Greg Beaver\'s Blog: subtle PHP 4 to PHP 5 difference regarding objects

RefreshinglyBlue Blog: PHP vs Ruby - Practical Language Differences

Tobias Schlitt\'s Blog: We go stable - eZ components 1.0


Community Events

Don't see your event here?
Let us know!


interview symfony2 library release php7 community version extension opinion xdebug podcast series performance framework voicesoftheelephpant api introduction example conference laravel

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework