Closed Thread
Results 1 to 8 of 8

Thread: Impossible to connect to the server

  1. #1
    Stryk0ur is offline x10Hosting Member Stryk0ur is an unknown quantity at this point
    Join Date
    May 2006
    Location
    M'Saken
    Posts
    21

    Question Impossible to connect to the server

    $fp=@fsockopen($host,$port,&$errno,&$errstr,10);

    and with this command too
    $fp = fsockopen($host,$port,&$errno,&$errstr,10);
    Impossible to connect to the server
    host: 84.95.247.20
    port: 6958

    it's a SHOUTcast streaming server , why it do'esnt work , and under my computer in local with easyphp it work ....??? http server of x10hosting are under firewall or what ?

  2. #2
    Marko's Avatar
    Marko is offline x10Hosting Member Marko is an unknown quantity at this point
    Join Date
    Apr 2006
    Posts
    45

    Re: Impossible to connect to the server

    Quote Originally Posted by Stryk0ur
    http server of x10hosting are under firewall or what ?
    Hosting service under firewall? lol:biggthump
    Of course not


  3. #3
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Impossible to connect to the server

    Are you behind a router?

  4. #4
    Stryk0ur is offline x10Hosting Member Stryk0ur is an unknown quantity at this point
    Join Date
    May 2006
    Location
    M'Saken
    Posts
    21

    Unhappy Re: Impossible to connect to the server

    so why connection is impossible ? and when I test script on my computer it work ?

  5. #5
    Marko's Avatar
    Marko is offline x10Hosting Member Marko is an unknown quantity at this point
    Join Date
    Apr 2006
    Posts
    45

    Re: Impossible to connect to the server

    Bryon asked:
    Quote Originally Posted by Bryon
    Are you behind a router?
    And what program you use to coonect?
    Last edited by Marko; 05-30-2006 at 04:28 PM.


  6. #6
    Stryk0ur is offline x10Hosting Member Stryk0ur is an unknown quantity at this point
    Join Date
    May 2006
    Location
    M'Saken
    Posts
    21

    Unhappy Re: Impossible to connect to the server

    no I am not I try this
    <?php
    $fp = fsockopen ("http://84.95.247.20", 6958, $errno, $errstr, 30);
    if(!$fp) {
    echo $errstr;
    } else {
    fwrite($fp, "GET / HTTP/1.1\r\nHost: http://84.95.247.20:6958\r\nConnection: Keep-Alive\r\n\r\n");
    $data = '';
    while(!feof($fp)) {
    $data .= fread($fp, 4096);
    if(substr($data, -9)=="\r\n\r\n0\r\n\r\n") {
    exit;
    }
    }
    }
    echo $data;
    ?>
    and I found Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /backup/home/stryk0ur/public_html/socks.php on line 2

    Warning: fsockopen(): unable to connect to http://84.95.247.20:6958 in /backup/home/stryk0ur/public_html/socks.php on line 2
    Success

  7. #7
    Bryon is offline Administrator Bryon has disabled reputation
    Join Date
    Apr 2005
    Location
    Northfield, NH
    Posts
    7,608

    Re: Impossible to connect to the server

    Hmm,.. . You never answered my question, but anyways.. I think I know what is causing the problem you're having.

    The PHP function fsockopen() does not support the URL transport/wrapper "http://", instead you could just use the IP address alone, like:

    Code:
    fsockopen('84.95.247.20', 6958, $errno, $errstr, 30);

    Try that out and let me know how it turns out.

    Also for your reference, you could check out PHP's supported socket transports.
    Last edited by Bryon; 05-30-2006 at 04:48 PM.

  8. #8
    Stryk0ur is offline x10Hosting Member Stryk0ur is an unknown quantity at this point
    Join Date
    May 2006
    Location
    M'Saken
    Posts
    21

    Unhappy Re: Impossible to connect to the server

    sorry I am not behind firewall or router

    with http I found this error
    Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /backup/home/stryk0ur/public_html/socks.php on line 2

    Warning: fsockopen(): unable to connect to http://84.95.247.20:6958 in /backup/home/stryk0ur/public_html/socks.php on line 2
    Success
    without http i found this error
    Warning: fsockopen(): unable to connect to 84.95.247.20:6958 in /backup/home/stryk0ur/public_html/socks.php on line 2
    Connection timed out
    script is
    <?php
    $fp = fsockopen('84.95.247.20', 6958, $errno, $errstr, 10);
    if(!$fp) {
    echo $errstr;
    } else {
    fwrite($fp, "GET / HTTP/1.1\r\nHost: http://84.95.247.20:6958\r\nConnection: Keep-Alive\r\n\r\n");
    $data = '';
    while(!feof($fp)) {
    $data .= fread($fp, 4096);
    if(substr($data, -9)=="\r\n\r\n0\r\n\r\n") {
    exit;
    }
    }
    }
    echo $data;
    ?>
    when I rty in my IE explorer 84.95.247.20:6958 is does'nt work but with http://84.95.247.20:6958 it work !
    maybe fsockopen it's disactivated can u try it by yourself ? to chek and thanks .....
    Last edited by Stryk0ur; 05-30-2006 at 05:06 PM.

Closed Thread

Similar Threads

  1. Internal Server Error
    By repusmod in forum Free Hosting
    Replies: 16
    Last Post: 06-19-2006, 01:53 PM
  2. Suggestion For A Server Alert Page
    By Besley in forum Feedback and Suggestions
    Replies: 5
    Last Post: 05-28-2006, 03:37 PM
  3. can't connect to mysql server
    By archer282 in forum Free Hosting
    Replies: 1
    Last Post: 12-15-2005, 03:53 PM
  4. PHP Server Status.
    By Nathan in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 07-12-2005, 08:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers