SecureTransport可以"/> SecureTransport可以">

Heim >Backend-Entwicklung >PHP-Tutorial >解决OSX上面PHP curl SSLRead error curl error 56 curl error 35 curl error 2

解决OSX上面PHP curl SSLRead error curl error 56 curl error 35 curl error 2

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 08:48:421425Durchsuche

这个问题的原因是因为OSX curl默认使用 SecureTransport 而不是OpenSSL.

在终端可以执行以下检查当前SSL version用的是SecureTransport还是OpenSSL.

<code>$ php -i | grep "SSL Version"</code>
如果返回结果是如下,当用curl的时候会报SSLRead() error。
<code>SSL Version => SecureTransport</code>

可以通过重新编译curl使其支持OpenSSL.

编译curl支持openssl:
./configure --prefix=/usr/local/curl --without-nss --with-ssl=/usr/local/Cellar/openssl/1.0.2d_1/
make
make install

PHP中如果没添加curl扩展可以通过以下方式编译添加:

添加curl扩展
phpize
./configure --with-php-c/local/php-5.6.16/bin/php-config --with-curl=/usr/local/curl/
make
make install

以上就介绍了解决OSX上面PHP curl SSLRead error,包括了error,curl方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn