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

curl-and-php

CLI CURL problem, happens only on the CLI?

From: Mike <fromlists_at_talkingspider.com>
Date: Tue, 22 Jul 2008 23:02:39 -0400

I have a php script that runs from command line and makes an https
request to paypal, using curl. It works fine if I run it from a web
page. It fails if I run it from CLI (using the same exact php install).
The error I get from the CLI:

* About to connect() to api-3t.sandbox.paypal.com port 443
* Trying 216.113.191.88... * connected
* Connected to api-3t.sandbox.paypal.com (216.113.191.88) port 443
* successfully set certificate verify locations:
* CAfile: /usr/share/ssl/certs/ca-bundle.crt
CApath: none
* Unknown SSL protocol error in connection to api-3t.sandbox.paypal.com:443
* Closing connection #0
*** glibc detected *** free(): invalid pointer: 0x00dc8c80 ***
Aborted

Again, if I view the script from the browser it runs fine, no errors..

I also tried running it as root on the CLI in case it was a permissions
problem.

When I echo phpinfo() from the CLI, it looks the same as when I print it
in the browser. I even threw in an obscure setting in there to compare
it with both.

CURL shows up in both phpinfo's (from CLI or web) as:

CURL support => enabled
CURL Information => libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.3 libidn/0.5.6

More info:

$ php -v
PHP 5.1.4 (cli) (built: Jun 8 2006 18:09:19)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-07-23