Questions tagged [curl-multi]

is refer to multiple synchronous curl transfers

197 questions
1
vote
1 answer

An example of PHP curl_multi_exec() without curl_multi_select()?

Does anyone have an example of using curl_multi_exec() without curl_multi_select() ? One of our servers still uses Centos5 with PHP5.1.x. Also the example should allow processing the handles before everyone has finished. My implementation has…
Antti Rytsölä
  • 1,485
  • 14
  • 24
1
vote
2 answers

Is this the best way to make an API request using PHP CURL?

I have a site that has a simple API which can be used via http. I wish to make use of the API and submit data about 1000-1500 times at one time. Here is their API: http://api.jum.name/ I have constructed the URL to make a submission but now I am…
Abs
  • 56,052
  • 101
  • 275
  • 409
0
votes
1 answer

Loading 30,000 URLs with PHP curl_multi_init returning empty string

I'm trying to load around 30,000 URLs in PHP. To complete this task as quickly as possible I'm trying to use curl_multi_init(). However it appears to be loading all 30,000 at once where as my understanding was it would process 10 at a time unless…
Mr J
  • 2,655
  • 4
  • 37
  • 58
0
votes
0 answers

PHP curl_multi impact on apache MPM Workers

From apache library: Worker MPM (uses multiple child processes that can have multiple threads each. Each thread handles one connection at a time) Prefork MPM (uses multiple child processes with one thread each. Each process handles one connection at…
drozdo
  • 319
  • 2
  • 11
0
votes
1 answer

Multiple API calls simultaniously in PHP

I'm trying to request multiple APIs as fast as possible. So i've tried curl_multi. But I get slower results than with foreach and file_get_contents. What am I doing wrong? With file_get_contents:
0
votes
0 answers

Process curl_multi_exec results while in progress?

I am building a simple web spider using built-in PHP cURL multi. It works great. Here is the basic implementation: I am building a simple web spider using built-in PHP cURL multi. It works great. Here is the basic…
William Entriken
  • 37,208
  • 23
  • 149
  • 195
0
votes
1 answer

Why is Multi Curl returning empty string?

Why am I not getting a response when using multi curl? When making a single post request, everything works as expected. Is there something I am missing in the code below? $urls = array( '', 'http://example.com', 'http://example.com', …
jasone
  • 55
  • 7
0
votes
0 answers

client C for API calls with curl_multi_*

I would like to create a C client that makes asynchronous API calls with lib curl and saves the responses, the calls are about a hundred at the same time. I have been looking for internet tutorials and examples for curl_multi_ * and…
federikowsky
  • 518
  • 2
  • 8
0
votes
0 answers

scrape more than 1000 product detail using curl php from shopee then store to database

I have a project to make shopee product scraping. Scraping for some products is successful, but if there are thousands of products, only hundreds of products are successful, the rest fail and the error is "forbidden". I've tried using three php…
0
votes
1 answer

CURL testing many ip addresses of a url in the same time: Response PROBLEM

Am making a curl request on an URL. this URL is hosted by many servers ==> many ip addresses. Imagine "www.example.com" is hosted by 192.168.60.31 198.166.15.15 217.15.74.1 here is the test that i did: public function curlInfosMulti($ips,$url,…
ProXamer
  • 377
  • 1
  • 9
  • 25
0
votes
2 answers

Working curl_multi_perform() example in C

I spent a few hours trying to figure out how to implement curl_multi_perform() in a general sort of way. This example may help out others. It basically takes a struct object and places all curl output into that as a character string. The…
NorthStar
  • 81
  • 9
0
votes
2 answers

Too many sockets open by cURL multi

I am using cURL multi to get data from some websites. With code: function getURL($ids) { global $mh; $curl = array(); $response = array(); $n = count($ids); for($i = 0; $i < $n; $i++) { $id = $ids[$i]; $url =…
0
votes
1 answer

PHP curl_multi removing and closing lingering handles

I have a loop that goes through approximately 3k urls using curl_multi and I need to know of away to remove any remaining handles from curl_multi to make sure I'm not wasting resources... is there any way to do it, or do I have to go though each of…
Serj Sagan
  • 28,927
  • 17
  • 154
  • 183
0
votes
0 answers

CURLMOPT_MAX_CONNECTION doesn't seem to work

I make requests to Api, there is a limit on api for no more than 5 parallel requests , this CURLMOPT_MAX_CONNECTION doesn't seem to work, what am I doing wrong. I could use simple curl, but it throws a 500 error. I will be glad for any help. foreach…
john Wick
  • 1
  • 1
0
votes
1 answer

How to use curl_multi on multiple url? "simple way"

I need to use curl_multi to get http codes from urls but my code is not working. I am able to scan urls but curl_getinfo always returns 0. i tried without multi api but then checking takes forever $i = 0; $ch = curl_multi_init(); …
stack
  • 1
  • 4