Results 1 to 1 of 1

Thread: fsockopen cannot reach my server

  1. #1
    Join Date
    May 2008
    Beans
    2

    Cool fsockopen cannot reach my server

    The ubuntu server 7.10 runs behind a router with a port mapping using port 25011. I can access the website hosted on the server from outside the router. I have another hosting space where I place the main page of the website. Visitors go to the main page first, where php script fsockopen determines the first server status and redirects accordingly.

    I have tested the pingDomain function (below), and it works fine to reach sites like google.com or yahoo.com

    But, I cannot reach the first server. Forget to mention that I test port check with http://www.canyouseeme.org/, it says port 25011 is reachable.

    PHP Code:
    <?php

    // Function to check response time
    function pingDomain($domain){
        
    $file fsockopen ($domain25011$errno$errstr8);
        
        echo 
    $errno;
        echo 
    $errstr;
        
    $status 0;

        if (!
    $file$status = -1;  // Site is down
        
    else {
                
    $status 1;
                
    fclose($file);
        }
        return 
    $status;
    }
    ?>
    I dont know what is the problem. Is it the problem of ubuntu server configuration or PHP?

    Please help. Thanks in advance
    Last edited by rocksoccer; May 30th, 2008 at 05:48 AM.

Bookmarks

Posting Permissions

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