Re: CURL questions
| From: | Chris | Date: | Thu, 29 Mar 2007 23:59:37 +0000 |
| Subject: | Re: CURL questions | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251708@lists.php.net to get a copy of this message | ||
Angelo Zanetti wrote:
y Erik Jones wrote:Try fetching google or yahoo - if that doesn't work, it'll probably be a firewall issue (your host won't allow outgoing http requests), so talk to your host. If you can't fetch pages on just your server then that's a separate problem that your host will need to look at. -- Postgresql & php tutorials http://www.designmagick.com/On Mar 29, 2007, at 11:15 AM, Angelo Zanetti wrote:yes i have tested with the browser, it works fine. I have removed the duplicate entry however its still giving the error do you think they are blocking the request? or should I be doing the request on a certain port?Hi all. I have a script on a server that does some processing, now I want to execute that script using cURL. This is a basic scenario and I assume its possible but its not working. The script is as follows: $url = "http://www..../test.php";Well, have you tested callling the script directly from a browser? Also, note that your setting CURLOP_RETURNTRANSFER twice and that my be messing with the curl call.$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_TIMEOUT, 100); $data = curl_exec($ch); curl_close($ch); echo "DATA: " . $data;Now the $url I have taken out the path for obvious reasons. I get a 500 Internal server error, not sure why as this page being called just inserts a word into a database. Could the cause be something else network related? What else can I troubleshoot? or is my code incorrect?