![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
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. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
|
so are you making your fopen call the old way and looping through fgets?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
|
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
__________________
subarus. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
Quote:
What's the "new" way to make the fopen call? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
Quote:
![]() (Ok, so I was desperate... and tired...) |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
|
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.
__________________
![]() ![]() ![]() It's all disambiguation ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Rock Hill, SC
Posts: 5,370
|
ditto... I have been using curl exclusively because it is just superior. The only issue is that you can't have open_basedir enabled.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: May 2004
Posts: 6,660
|
curl is the way to go. So many more options and features.
__________________
![]() Skype: JohnA1078 Too Much Media - Makers of the Industry's Leading Payite Management Platform, NATS! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
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
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
nation-x already nailed the prob, it's a PHP bug...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Guest
Posts: n/a
|
cURL ftw!
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Too lazy to set a custom title
Join Date: Dec 2006
Posts: 23,400
|
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.
__________________
i like waffles |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
bug or not, no one uses fopen for this kind of stuff... use curl instead, 10x more reliable..
![]()
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |