I locally installed 2 Apache Server on port 80 and port 81 using XAMPP. Yam was able to successfully access them through my browser. URLs are currently available at
http:
and
http:
When I try to write a simple cone code for them
$ch=curl_init(); $url = "http://27.4.198.225/ncmsl/check.php"; curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); curl_setopt($ch, CURLOPT_URL, $url); curl_exec($ch); curl_close($ch);
It works fine for the server on port 80, but does not work for the server on port 81, i.e.
$ch=curl_init(); $url = "http://27.4.198.225:81/ncmsl/check.php"; curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); curl_setopt($ch, CURLOPT_URL, $url); curl_exec($ch); curl_close($ch);
What could be the reason? I tried using CURLOPT_PORT, but this also does not work.
These URLs are LIVE URLs. Can anyone check if they can successfully access them using their own CURL code on their own network.
source share