Paul J
Paul J

Reputation: 777

Capture curl stderr and print stdout in php

I'm using curl & php and something's not working.

How can I capture STDERR and print it to STDOUT in php when running through a web server?

Thanks

Upvotes: 1

Views: 1252

Answers (2)

Nemoden
Nemoden

Reputation: 9056

if (curl_errno($ch)) { echo curl_error($ch); }

Upvotes: 1

xkeshav
xkeshav

Reputation: 54072

TRY with

curl_setopt($curl,CURLOPT_FAILONERROR,FALSE); and print the error
$result = curl_exec($curl); by print_r($result);

Upvotes: 0

Related Questions