Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,798
    Thanks
    19
    Thanked 156 Times in 147 Posts

    fsockopen() issue

    I get the following PHP errors when trying to connect to MSN's servers via port 1863:

    Warning: fsockopen(): php_hostconnect: connect failed in /home/httpd/vhosts/mediamogulsweb.com/httpdocs/client/block_checker2.php on line 7

    Warning: fsockopen(): unable to connect to messenger.hotmail.com:1863 in /home/httpd/vhosts/mediamogulsweb.com/httpdocs/client/block_checker2.php on line 7
    This is the code that I'm using to connect:

    PHP Code:
    $link "messenger.hotmail.com";

    $GLOBALS['connect'] = fsockopen($link1863, &$errno, &$errstr20); 
    I am wondering if there is some PHP directive that is not allowing me to execute this code properly...My server is remotely hosted, so perhaps I need to contact my web hosting provider? Or is this a coding issue?

    Thanks for any advice.
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    What version of PHP are you running? Here is an interesting tidbit from the manual:

    As of PHP 4.3.0, if you have compiled in OpenSSL support, you may prefix the hostname with either 'ssl://' or 'tls://' to use an SSL or TLS client connection over TCP/IP to connect to the remote host.
    Don't know if that helps or not. You might want to read the rest of what it says about fsockopen while you're at it.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    Senior Coder chump2877's Avatar
    Join Date
    Dec 2004
    Location
    the U.S. of freakin' A.
    Posts
    2,798
    Thanks
    19
    Thanked 156 Times in 147 Posts
    I tried adding those prefixes to the hostname, but they didn;t help....

    I modified my code slightly to echo the errors triggered by fsockopen():
    PHP Code:
        $link "messenger.hotmail.com";

        
    $GLOBALS['connect'] = fsockopen($link1863$errno$errstr50);
        if (!
    $GLOBALS['connect'])
        {
            echo 
    "$errstr ($errno)<br>";
        } 
    I still get the same PHP warnings as before, but at least now I get an actual indication of what the problem is....echo "$errstr ($errno)<br>"; returns:

    Connection timed out (110)
    I tried bumping up the timout parameter in fsockopen() but that didn;t seem to help...

    any other ideas?
    Regards, R.J.

    ---------------------------------------------------------

    Help spread the word! Like my YouTube-to-Mp3 Conversion Script on Facebook !! :)
    [Related videos and tutorials are also available at my YouTube channel and on Dailymotion]
    Get free updates about new software version releases, features, and bug fixes!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •