curl或file_get_contents忽略输出

I need to run a php code in a different server (let's call it server 2) from server 1.

In server 1, I have something like this

<?php
file_get_contents('http://domain_in_server_2.com/php-script.php');
?>

The problem is, this request may take long time, and I don't need to get the output. I just want to trigger the script without having to wait or getting the output.

Is there anyway to accomplish what I want?

Thank you very much.

You can use a socket. See this example.

Edit:

Here is the code from the above link:

// Example:
// post_async("http://www.server.com/somewhere",array("foo" => 123, "bar" => "ABC"));

function post_async($url, $params)
{
    // Build POST string
    foreach ($params as $key => &$val) {
      if (is_array($val)) $val = implode(',', $val);
      $post_params[] = $key.'='.urlencode($val);
    }
    $post_string = implode('&', $post_params);

    // Connect to server
    $parts=parse_url($url);
    $fp = fsockopen($parts['host'],isset($parts['port'])?$parts['port']:80,$errno, $errstr, 30);

    // Build HTTP query             
    $out = "$type ".$parts['path']." HTTP/1.1
";
    $out.= "Host: ".$parts['host']."
";
    $out.= "Content-Type: application/x-www-form-urlencoded
";
    $out.= "Content-Length: ".strlen($post_string)."
";
    $out.= "Connection: Close

";
    $out.= $post_string;

    // Send data and close the connection
    fwrite($fp, $out);
    fclose($fp);
}