![]() |
PHP: something between 5.2.9 and 5.2.11 is causing connections to close prematurely?
I have a couple of sites that use URL fopen wrappers to fetch content remotely, and some others that do it at a more low level with fsockopen+fread. Works fine on a server with PHP 5.2.9, but after moving the sites to a server with PHP 5.2.11 I'm seeing data from outbound connections consistently truncated; it appears the connection is closing prematurely for some reason.
Downgrading to 5.2.9 on the new server seems to have fixed the problem. Anyone else seen this? Remember it's for OUTBOUND connects initiated by a script. :error |
so are you making your fopen call the old way and looping through fgets?
|
Have you tried alternative methods such as one of the following?
http://usphp.com/manual/en/class.httprequest.php http://php.net/manual/en/book.curl.php |
Quote:
What's the "new" way to make the fopen call? |
Quote:
(Ok, so I was desperate... and tired...) |
Go with the alternative. Give Curl a try.
It's hard to guess... but it sounds like the data type/size maybe format, is causing you issues. I have found curl to be extremely powerful and flexible... then again, I don't know sockets all that well. |
Quote:
|
curl is the way to go. So many more options and features.
|
try executing a curl or wget process with nohup instead.
Other then that, check out fopen timeout settings in php.ini. The default setting might be different in different php versions |
nation-x already nailed the prob, it's a PHP bug...
|
cURL ftw!
|
cURL for the win... my host for instance, blocks fopen() by default (security measures)... so if a script uses fopen exclusively... I can't use it.
|
bug or not, no one uses fopen for this kind of stuff... use curl instead, 10x more reliable.. :2 cents:
|
All times are GMT -7. The time now is 01:59 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123