Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

curl_exec() failure - cURL help anyone?

Status
Not open for further replies.

miahmiah900

Programmer
Sep 19, 2003
38
US
I have not been able to get a cURL request to work in PHP. Is there anyone that can suggest a solution for me?

Everytime I use curl_exec() in PHP to do anything, it works and works for a long time and never produces a result.

I would ask as I have tried many things and cannot find a way to fix the problem. I have tried it on different static urls which should work fine, and curl_exec() still produces nothing.

I have seen curl work before, only on a different server that I no longer use though. I have tried simplified examples and they produce no result. Right now I have no idea where the problem is.
 
here is the most basic code i used to test, which produced the ever-working blank page (no result).

Code:
<?
// create a new curl resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, "[URL unfurl="true"]http://www.houseleng.com");[/URL]
curl_setopt($ch, CURLOPT_HEADER, 0);

// grab URL and pass it to the browser
curl_exec($ch);

// close curl resource, and free up system resources
curl_close($ch);
?>
 
What about a proxy? I believe you need to specify that option.
 
ah... my host tells me that they have a custom firewall so that i cannot access other urls from a php script. thanks for the replies. (they will add individual urls to the whitelist for me though)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top