I've increased the timeout but it doesn't work.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost.com/test.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 999);
$response = curl_exec($ch);
print_r($response);