Webspace & Domain Names This is a discussion on, fsockopen - help please within the Freedom2Surf forum; I used to use fsockopen() and it worked fine in my php script. Same script runs fine at home on ...

Reply
 
LinkBack Thread Tools
Old 04-06-2009, 03:49 AM   #1
Tiscali User Member
 
php4ever's Avatar
 
Join Date: Jul 2002
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
fsockopen - help please

I used to use fsockopen() and it worked fine in my php script. Same script runs fine at home on my desktop in a WAMP environment but fails now at f2s. The problem apparently is that the timeout parameter to connect to the remote server is set to 15 at f2s whereas my default value at home is 60. Tried to change the default value at f2s using ini_set() and it failed apparently.

Last edited by php4ever; 08-06-2009 at 09:36 AM.
php4ever is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-06-2009, 06:28 AM   #2
Tiscali User Member
 
php4ever's Avatar
 
Join Date: Jul 2002
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Re: fsockopen - help please

I also thought maybe I could get around the fsockopen() issue by using curl. Wrote a curl script and it executed fine on my local server but as soon as I uploaded that script to f2s, it failed! Now, according to my understanding curl is enabled at f2s, so why would my script work on my local web server and fail at f2s?
php4ever is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-06-2009, 09:16 AM   #3
Tiscali User Member
 
JeffG's Avatar
 
Join Date: Feb 2005
Location: Newbury
Posts: 275
Thanks: 1
Thanked 0 Times in 0 Posts
Re: fsockopen - help please

Don't know anything about fsockopen(), but I did spot this in the manual - don't know if it's relevant:

Quote:
Originally Posted by PHP manual
Note: If you need to set a timeout for reading/writing data over the socket, use stream_set_timeout(), as the timeout parameter to fsockopen() only applies while connecting the socket.
Hmm. Re-reading your post, probably not. But anyway...
JeffG is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-06-2009, 01:20 AM   #4
Tiscali User Member
 
php4ever's Avatar
 
Join Date: Jul 2002
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Re: fsockopen - help please

JeffG,

Thanks for trying to help me out. But as you realized, the timeout that is the issue here is the connection timeout which has a default of 60 on my localhost on my desktop but f2s has given it a default of 15. Why? That's the mystery!
php4ever is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 07-06-2009, 08:30 PM   #5
Former Freedom2Surf Staff
 
Join Date: Sep 2005
Posts: 10
Thanks: 0
Thanked 2 Times in 2 Posts
Re: fsockopen - help please

[QUOTE=php4ever;95878 The problem apparently is that the timeout parameter to connect to the remote server is set to 15 at f2s whereas my default value at home is 60. QUOTE]


It depends what/where the remote server is?
brian_ex-f2s is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 08-06-2009, 09:33 AM   #6
Tiscali User Member
 
php4ever's Avatar
 
Join Date: Jul 2002
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Re: fsockopen - help please

Gotta say that overall what was initially a bit frustrating turned out to be a great learning experience. Thank you everyone for your input.
php4ever is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT. The time now is 05:38 PM.