my environment: LINUX 2.6.9 Fedora Core 7
Apache 2.2
PHP 5.2.6
I am having difficulty using CURL to access a remote server on a non-standard port.
Example: The url (http://socket.carfax.com:8080) should should return the following: "901 Transaction Error". Type it into a browser address window and it returns the desired result.
The following php script attempts to do the same via CURL, three different ways. All return the same result....nothing....
<?
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://socket.carfax.com");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PORT, '8080');
$res = curl_exec($ch);
curl_close ($ch);
echo ("<br>results of test #1=$res");
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://socket.carfax.com");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PORT,8080);
$res = curl_exec($ch);
curl_close ($ch);
echo ("<br>results of test #2=$res");
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, "http://socket.carfax.com:8080");
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
curl_close ($ch);
echo ("<br>results of test #3=$res");
?>
Does anyone have any suggestions what I am doing wrong. I'm not very familar with CURL but it appears quiet straightforward.
Thanks in advance.
Bill