Skip to main content

Debug PHP Curl

12th October, 2022

Updated: 12th October, 2022

    Source

    ob_start();  
    $out = fopen('php://output', 'w');
    
    //
    
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_VERBOSE, true);  
    curl_setopt($curl, CURLOPT_STDERR, $out);  
    
    // After the curl_exec() 
    
    fclose($out);  
    $debug = ob_get_clean();
    
    //
    
    echo '<pre>';
    print_r($debug);
    echo '</pre>';

    f0d9b82d-3e69-45e5-beb7-cf05de13535d

    Created on: 12th October, 2022

    Last updated: 12th October, 2022

    Source: Debugging cURL Requests In PHP

    Tagged With: