cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: PHP - CURL - Custom authentication script

From: David Colter <dolan2go_at_yahoo.com>
Date: Tue, 29 Mar 2011 12:15:15 -0400

Michael,

I had a steep learning curve with verbose output in the beginning.

> and still nothing. Is there anything Im missing here? When verbose is on, should I get an output printed on the screen automatically?

The verbose output goes to file and is extensive and helpful.

Try something like this:

// to the 'debug' sub-directory, create the verbose.txt file with permissions 644
// insert your path in place of '/home/abc_directory/public_html'

$verbose_file = '/home/abc_directory/public_html/debug/verbose.txt';
$fp = fopen ( $verbose_file, 'w+' );

curl_setopt ( $ch1, CURLOPT_VERBOSE, TRUE );
curl_setopt ( $ch1, CURLOPT_STDERR, $fp );

and,

// curl doesn't send post data string to verbose output (only the content-length), so,
fwrite ( $fp, "Post data sent: " . $posts . "\n\n" );

This output will shine a giant light on what's going on behind the curl scene. Then compare verbose.txt to Live HTTP headers as I stated in the previous email. With followlocation, true the verbose and troubleshooting can get tricky (difficult to interpret). In the beginning, I'd try to repeat the requests individually from Live Headers until getting the desired result for
echo $content4;

> One of the input fields has a very very long value and I of course try to submit it too. Do you think that it matters?

I think it's more likely that your curl post string is not sending the correct 'pieces' for the server to respond. In your corrected reply the upload size is 1994 and very telling is the 0 for download size.

Get out the magnifying glass and compare the verbose to Live Headers.

David
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2011-03-29