#1 (permalink)  
Old 05-23-2005, 01:38 PM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
Warning: fsockopen(): unable to connect to

Hello,


None of my users (including a few of my own sites) have the right to open a connection (fsockopen) to another server.

"Warning: fsockopen(): unable to connect to *** "

Why is this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-24-2005, 02:19 AM
Registered User
 
Join Date: Jul 2003
Posts: 23
brainx
Hi,

This probably is caused by your firewall configuration.You may need to allow both incoming and outgoing access for the ip and/or the port number you wish to connect to.

We had similar issues before and have solved them this way.Hope it helps.
Thanks
__________________
Brain Hosting, Inc.
Exceeding Your Expectations
Visit us at
www.brainhosting.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-24-2005, 01:45 PM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
Quote:
Originally Posted by brainx
Hi,

This probably is caused by your firewall configuration.You may need to allow both incoming and outgoing access for the ip and/or the port number you wish to connect to.

We had similar issues before and have solved them this way.Hope it helps.
Thanks
no, our firewall does not have any rules against this. It allows all outbound traffic, inbound is filtered.

It has to do something with PHP, just can't figure it out?


Wieger.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-24-2005, 02:56 PM
Registered User
 
Join Date: Jun 2003
Posts: 280
richy is on a distinguished road
Are you able to connect using telnet from the server to the exact same remote server?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-25-2005, 05:48 AM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
With SSH it all goes well.. telnet returns valid information.

It's only when i want to fsockopen() with a script.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 05-25-2005, 06:09 AM
Registered User
 
Join Date: Oct 2002
Posts: 744
jamesbond is on a distinguished road
Did you check the allow_url_fopen setting in php.ini ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 05-26-2005, 02:25 PM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
Quote:
Originally Posted by jamesbond
Did you check the allow_url_fopen setting in php.ini ?
phpinfo says;

allow_url_fopen On On
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 05-30-2005, 08:01 AM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
So, any options?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 05-30-2005, 09:09 AM
Registered User
 
Join Date: Jan 2005
Posts: 1,874
webignition is on a distinguished road
From the PHP manual (http://pl2.php.net/manual/en/function.fsockopen.php):

Quote:
If the call fails, it will return FALSE and if the optional errno and errstr arguments are present they will be set to indicate the actual system level error that occurred in the system-level connect() call. If the value returned in errno is 0 and the function returned FALSE, it is an indication that the error occurred before the connect() call. This is most likely due to a problem initializing the socket. Note that the errno and errstr arguments will always be passed by reference.
Try specifying the optional paramaters errno and errstr and then print them afterwards. This should give you more specific errors which should aid the troubleshooting process.

PHP Code:
$fp fsockopen ("example.com/index.html"80$errno$errstr30);
if (
$fp === false) {
  print(
$errno." : ".$errstr);

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 05-31-2005, 03:06 AM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
Quote:
Originally Posted by webignition
From the PHP manual (http://pl2.php.net/manual/en/function.fsockopen.php):



Try specifying the optional paramaters errno and errstr and then print them afterwards. This should give you more specific errors which should aid the troubleshooting process.

PHP Code:
$fp fsockopen ("example.com/index.html"80$errno$errstr30);
if (
$fp === false) {
  print(
$errno." : ".$errstr);

As i said, permission denied?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 06-02-2005, 09:57 AM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
So, again no options..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 06-02-2005, 10:02 AM
Registered User
 
Join Date: Jan 2005
Posts: 1,874
webignition is on a distinguished road
I suppose if you've exhausted all of the options presented here and you're still unable to resolve the problem, all I could suggest would be:

1. Thoroughly search the forums in case there is a thread on this that you missed
2. Use Google or some other search engine to hunt for solutions
3. Contact your data center for support
4. Hire someone if you're unable to resolve the issue yourself
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 06-17-2005, 02:51 AM
Registered User
 
Join Date: Oct 2004
Posts: 50
itrends is on a distinguished road
done all that, nobody seems to know.. but i found someone with the same problem on the forum (also, no sollution?)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

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



All times are GMT -5. The time now is 08:16 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc