S
S
shearlocktm2015-09-28 17:21:12
PHP
shearlocktm, 2015-09-28 17:21:12

CURL Why is the server returning an incomplete response?

Good afternoon!
The problem is this:
When requesting JSON from a third-party server, the response comes in an incomplete form, and each time in a different way.
The request looks like this:

$ch = curl_init('http://blabla.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 0);
$result = curl_exec($ch);  
curl_close($ch);
$obj = json_decode($result, true);

var_dump($obj);

var_dump($obj) produces " array(1) { ["synced"]=> bool(true) } " or " array(3) { ["id"]=> string(32) "fac1bebad5e17bc88256f1ab22f6cccd" ["segments" ]=> array(1) { [0]=> array(5) { ["sources"]=> array(1) { [0]=> int(0) } ["price"]=> float(0 ) ["id"]=> string(4) "1477" ["extraInfo"]=> array(2) { ["segmentParams"]=> array(3) { ["rr"]=> float(1.44344984113E +12) ["r"]=> float(1.44344984113E+12) ["rf"]=> float(1) } ["lastDepth"]=> int(1) } ["prob"]=> float( 1) } } ["synced"]=> bool(true) } " or full answer.
Please tell me what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Optimus, 2015-09-28
Pyan @marrk2

max_input_time look at the server in php.ini, it helped me, and other maximum input values

S
synapse_people, 2015-09-28
@synapse_people

you need to look not at what is in obj, but what is in result...

P
Pavel Volintsev, 2015-09-28
@copist

nginx? Check write permissions in /var/lib/nginx/fastcgi/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question