I have a peculiar problem i am facing with Php CURL .
I am trying to call a web service running on a windows machine within the same network via a php script running on a centos workstation. I am using CURL. The problem is that i can access the URL with the browser and it works perfectly. BUt when i try to use the php script it gives an error code 7 .
HOwever if i try a local ip address and google in the php script it works with no issues. What could be the issue? I have been trying to get me head around this issue for the past few hours but i am not able to sort it.
I would also like to add, when i use crl via the terminal i get a proper reply. HTTP 200OK
Help Required :) $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADER => 1, CURLOPT_TIMEOUT => 4, CURLOPT_USERAGENT=>'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13', CURLOPT_VERBOSE => 1, CURLOPT_PORT => 9710, CURLOPT_URL => 'http://192.168.100.4:9710/http/send-message?message='.$message )); // Send the request & save response to $resp $resp = curl_exec($curl); echo "
Error Code : " .curl_errno($curl);