cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Curling to alternate ports

From: Bedford County Webmaster <webmaster_at_bedfordcountyweb.com>
Date: Fri, 04 Aug 2006 16:08:44 -0500

Hello,

New to curl - so please excuse if this is an obvious question.

I want to use CURL from a PHP script to access a web services server on its
own port number.

For example:

http://202.59.22.123:8089 (sample URL - not valid)

I have been trying to access it with this script:

<?
echo("Curl Test\n" );

$url = "http://202.59.22.123:8089";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_PORT , 8089);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$result = curl_exec($ch);

print_r(curl_getinfo($ch));
echo "\n\ncURL error number:" .curl_errno($ch);
echo "\n\ncURL error:" . curl_error($ch);

curl_close($ch);
echo $result;

?>

What I am experiencing is that the script will timeout in the CURL command.

For additional info - the server where the php script is running is on:

PHP 5.1.4
Curl 7.15.4

The web services system is running behind a SmoothWall installation. The
SmoothWall is doing a port forward for port 8089 to a specific system on
the LAN.

If I access the URL directly as:

http://202.59.22.123:8089

then it works fine - but the CURL always times out (despite what whatever
timeout value I use).

I'm quite happy and willing for someone to point out to me that I have some
obvious setting out of whack.

Thanks!

CJ

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-08-04