This is a problem using PHP with Curl (on hosted server). I am trying to control a remote device (LED state) on port 54512 (for example). The $url includes the IP:port number concatenated with a short CGI command.
The following is a code fragment;
$sensorIP = "77.134.85.187:54512"; // IP:port format
$url = $sensorIP . "/setParam.cgi?DOStatus_02=0" ; // set E2210 LED off
echo $url; //
$result = accessURL ($url); // set LED state on E2210 remote unit
This code times out. When I use the $url as an address in a web browser it works fine. So the receiving port 54512 is not blocked. When I use IP:80 to form $url it works fine (receiving port set to 80).I tried using the CURLOPT_PORT option and the PHP script still times out.
The sending server outgoing HTTP is NOT blocking any port numbers, I checked with my hosting company. They believe I have a programming error, but where?