CLI CURL问题,仅在CLI上发生? [英] CLI CURL problem, happens only on the CLI?

查看:50
本文介绍了CLI CURL问题,仅在CLI上发生?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从命令行运行的PHP脚本,并使用curl向paypal发出https

请求。如果我从网页上运行它可以正常运行

页面。如果我从CLI运行它会失败。我从CLI得到的错误:


*关于connect()到api-3t.sandbox.paypal.com端口443

*尝试216.113。 191.88 ... *连接

*连接到api-3t.sandbox.paypal.com(216.113.191.88)端口443

*成功设置证书验证位置:

* CAfile:/usr/share/ssl/certs/ca-bundle.crt

CApath:无

*未知的SSL协议错误连接到

api-3t.sandbox.paypal.com:443

*关闭连接#0

***检测到glibc ***免费( ):无效指针:0x00dc8c80 ***

中止


再次,如果我从浏览器查看脚本它运行正常,没有错误..


我也尝试在CLI上以root身份运行它,以防它是一个

权限问题。


当我来自CLI的echo phpinfo(),它看起来和我在浏览器中打印它的时候一样。我甚至在那里投入了一个不起眼的设置

将它与两者进行比较。 CURL显示在两者中:


CURL支持=启用

CURL信息= libcurl / 7.12.1 OpenSSL / 0.9.7a zlib / 1.2.3 libidn /

0.5.6

更多信息:


$ php -v

PHP 5.1.4 (cli)(建于2006年6月8日18:09:19)

版权所有(c)1997-2006 PHP小组

Zend Engine v2.1.0,版权所有(c )1998-2006 Zend Technologies


$ php -m

[PHP模块]

ctype

curl

date

dom

ftp

gd

hash
iconv

libxml

ming

mysqli

pcre

PDO

posix

反思

session

SimpleXML

肥皂

SPL

SQLite

标准

tokenizer

xml

xmlreader

xmlwriter

zlib

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. 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:

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

$ php -m
[PHP Modules]
ctype
curl
date
dom
ftp
gd
hash
iconv
libxml
ming
mysqli
pcre
PDO
posix
Reflection
session
SimpleXML
soap
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

推荐答案

php -v

PHP 5.1.4(cli)(建于2006年6月8日18:09:19)

版权所有(c)1997-2006 PHP小组

Zend Engine v2.1.0,版权所有(c)1998-2006 Zend Technologies
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


php -m

[PHP模块]

ctype

curl

日期

dom

ftp

gd

hash

iconv

libxml

ming

mysqli

pcre

PDO

posix

反思

session

SimpleXML

soap

SPL

SQLite

标准

tokenizer

xml

xmlreader

xmlwriter

zlib
php -m
[PHP Modules]
ctype
curl
date
dom
ftp
gd
hash
iconv
libxml
ming
mysqli
pcre
PDO
posix
Reflection
session
SimpleXML
soap
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter
zlib


7月22日晚上8:44,Flexor< yugyu ... @ hotmail.comwrote :
On Jul 22, 8:44 pm, Flexor <yugyu...@hotmail.comwrote:

我有一个从命令行运行的PHP脚本,并使用curl向paypal发出https

请求。如果我从网页上运行它可以正常运行

页面。如果我从CLI运行它会失败。我从CLI得到的错误:


*关于connect()到api-3t.sandbox.paypal.com端口443

*尝试216.113。 191.88 ... *连接

*连接到api-3t.sandbox.paypal.com(216.113.191.88)端口443

*成功设置证书验证位置:

* CAfile:/usr/share/ssl/certs/ca-bundle.crt

CApath:无

*未知的SSL协议错误连接到

api-3t.sandbox.paypal.com:443

*关闭连接#0

***检测到glibc ***免费( ):无效指针:0x00dc8c80 ***

中止


再次,如果我从浏览器查看脚本它运行正常,没有错误..


我也尝试在CLI上以root身份运行它,以防它是一个

权限问题。


当我来自CLI的echo phpinfo(),它看起来和我在浏览器中打印它的时候一样。我甚至在那里投入了一个不起眼的设置

将它与两者进行比较。 CURL显示在两者中:


CURL支持=启用

CURL信息= libcurl / 7.12.1 OpenSSL / 0.9.7a zlib / 1.2.3 libidn /

0.5.6


更多信息:

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. 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:

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

More info:


这篇关于CLI CURL问题,仅在CLI上发生?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆