I'm running Wordpress on MAMP and for some reason I get an error on all of my RSS feeds saying
WP HTTP Error: couldn't connect to host
I think its a configuration problem in MAMP with cURL, but not sure how to fix it. I have cURL enabled.
...
When i use this code,
$ch = curl_init($url);
$statuses = curl_exec($ch);
curl_close($ch);
I am returned what i want, but if i just use that - $statuses is echoed out onto the page, how can i stop this?
...
Take a look at the code below, it is a simple PHP script that uses cURL's multi handles feature:
// Initialize multi handle
$m = curl_multi_init();
// Initialize the actual curl handles
$c1 = curl_init();
curl_setopt($c1, CURLOPT_URL, 'http://speedtest.bbned.nl/download/file32mb.bin');
curl_setopt($c1, CURLOPT_RETURNTRANSFER, 1);
cur...
Hello!
I'm trying to test open proxies to figure out who to block from my site, but I'd like to do that through a proxy of my own. Using PHP and cURL, how would I go about doing so?
Is this what CURLOPT_HTTPPROXYTUNNEL is possibly used for..?
pseudo code:
Server (IP address A) connects to it's own proxy server (IP address B), which fo...
If i am making multiple calls to an api on each page in a web app, is cURL right for me, or is using simplexml_load_file with the URL wrapper OK?
Will opening, making the call, and closing the cURL connection multiple times negatively affect the app?
...
Hello
I have a cron job setup on one server to run a backup script in PHP that is hosted on another server. The command I've been using is formatted like this:
curl -sS http://www.example.com/backup.php
Lately I've been getting this error when the Cron runs
curl: (52) Empty reply from server
I have no idea what this means. If I ...
Hello Experts,
This is a two part question.
Q1: Can cURL based request 100% imitate a browser based request?
Q2: If yes, what all options should be set. If not what extra does the browser do that cannot bee imitated by cURL?
I have a website and I see thousands of request being made from a single IP in a very short time. These reque...
Hello. I am trying to get information of remote file with curl. Problem is that other web-server is on port 81.
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt ($ch, CURLOPT_PORT , 81);
curl_setopt($ch, CURLOPT_URL, 'http://98.246.25.185/server_status2.php');
$store = curl_exec ($ch);
echo substr($store, 1...
I want to let a user of a web app enter a URL and then pass that URL onto curl. I'd rather use curl than Net::HTTP or open-uri. But this poses a security risk. What's the best way to check the URL string and prevent any injection attacks?
I'm thinking of just using a regular expression like this to check for an injection attack:
raise...
Does anybody know why could cURL under php5 be so damn slow to fail even at 45s timeout, downloading a few kb file on a speedO'light server?
The code is here as requested (although I upped the timeouts even more for the script not to fail during execution and changed useragent to Mozilla/4.0 from initial Chrome):
$ch = curl_init('http:...
Hi,
I am a PHP newbie and trying to add a progress-bar to an existing PHP script using the following method :
$ch=curl_init() or die("ERROR|<b>Error:</b> cURL Error");
curl_setopt($ch, CURLOPT_URL, $c);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_FILE, $fp);
//##############################################...
I've never done any curl before so am in need of some help. I've tried to work this out from examples but cannot get my head around it!
I have a curl command that I can successfully run from a linux(ubuntu) command line that puts a file to a wiki through an api.
I would need to incorporate this curl command in a PHP script I'm building...
I'm using PyCURL to test a redirection service we're offering- a user hits http://xyz.com/asdf/ and gets redirected to https://a.com, https://b.com and https://c.com.
I'm trying to use PyCURL to request http://xyz.com, and print out (but not HTTP request) the string "https://{a|b|c}.com", but whenever the destination URL is HTTPS and no...
Hello all,
I am trying to test the below function but every time I try to use any sort of proxy IP (I have tried about 15 now) - I generally get the same error:
Received HTTP code 0 from proxy after CONNECT
Here is the function, anything wrong with it? It could just be the proxies I am using but I have tried several times now.
funct...
Here is the dump from WireShark:
POST /drm/drm_production_v2.php HTTP/1.1
content-length: 278
content-type: text/xml
User-Agent: UserAgent 1.0
Connection: Keep-Alive
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
host: www.example.com
<methodCall>
<methodName>aMethod</methodName>
<params>
<param>
<value>
<b...
I'm having a problem using Curb (ruby curl bindings) for FTP downloads.
It looks like curb doesn't fall back to simple passive mode when extended passive mode fails. Extract from the log follows:
< 250 Directory changed to /outgoing/productcatalog/35591
> EPSV
* Connect data stream passively
< 229 Entering Passive Mode (|||40938|)
* ...
Hi there. Is there a PHP4 alternative to the function curl_multi_select()
...
Hi,
I'm writing a script to do some search on rentacoder.com and to get certain data, I need to login. I'm using PHP cURL library. While cURL works perfectly on other pages of this site (for example, to search or to fetch a coder / project page), I cannot make it work for login. It always returns me an error page saying - "UserId or Pas...
I want to get many pages from a website, like
curl "http://farmsubsidy.org/DE/browse?page=[0000-3603]" -o "de.#1"
but get the pages' data in python, not disk files.
Can someone please post pycurl code to do this,
or fast urllib2 (not one-at-a-time) if that's possible,
or else say "forget it, curl is faster and more robust" ? Thanks
...
Hello,
Can someone help me out on this.
I have a problem with the return results from an google-api call
I want to echo them back as html, but firefox keeps displaying a feed page.
In IE, I get an error saying that an xml document can only contain one toplevel element
wich must be the atom "feed" element, so I don't get that.
What ca...