这个问题的原因是因为osx curl默认使用 securetransport 而不是openssl.
在终端可以执行以下检查当前SSL version用的是SecureTransport还是OpenSSL.
<code>$ php -i | grep "SSL Version"</code>
<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扩展可以通过以下方式编译添加:
立即学习“PHP免费学习笔记(深入)”;
添加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教程有兴趣的朋友有所帮助。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号