The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Warning: fsockopen(): unable to connect to

Discussion in 'General Discussion' started by itrends, May 23, 2005.

  1. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  2. brainx

    brainx Member

    Joined:
    Jul 9, 2003
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  3. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  4. richy

    richy Well-Known Member

    Joined:
    Jun 30, 2003
    Messages:
    276
    Likes Received:
    1
    Trophy Points:
    16
    Are you able to connect using telnet from the server to the exact same remote server?
     
  5. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    With SSH it all goes well.. telnet returns valid information.

    It's only when i want to fsockopen() with a script.
     
  6. jamesbond

    jamesbond Well-Known Member

    Joined:
    Oct 9, 2002
    Messages:
    738
    Likes Received:
    1
    Trophy Points:
    18
    Did you check the allow_url_fopen setting in php.ini ?
     
  7. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    phpinfo says;

    allow_url_fopen On On
     
  8. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    So, any options?
     
  9. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    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:
    $fp fsockopen ("example.com/index.html"80$errno$errstr30);
    if (
    $fp === false) {
      print(
    $errno." : ".$errstr);
    }
     
  10. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    As i said, permission denied?
     
  11. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    So, again no options..
     
  12. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    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
     
  13. itrends

    itrends Well-Known Member

    Joined:
    Oct 21, 2004
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    done all that, nobody seems to know.. but i found someone with the same problem on the forum (also, no sollution?)
     
Loading...

Share This Page