SecureTransport OK"/> SecureTransport OK">
Home >Backend Development >PHP Tutorial >解决OSX上面PHP curl SSLRead error curl error 56 curl error 35 curl error 2
The reason for this problem is because OSX curl uses SecureTransport
by default instead of OpenSSL.
You can execute the following in the terminal to check whether the current SSL version uses SecureTransport
or OpenSSL.
<code>$ php -i | grep "SSL Version"</code>If the return result is as follows, when using curl SSLRead() error will be reported sometimes.
<code>SSL Version => SecureTransport</code>
You can recompile curl to support OpenSSL.
Compile curl to support openssl:
./configure --prefix=/usr/local/curl --without-nss --with-ssl=/usr/local /Cellar/openssl/1.0.2d_1/
make
make install
If the curl extension is not added to PHP, you can compile and add it in the following way:
Add curl extension
phpize
./configure --with-php-c/local /php-5.6.16/bin/php-config --with-curl=/usr/local/curl/
make
make install
The above introduces how to solve PHP curl SSLRead error on OSX, including error and curl aspects. I hope it will be helpful to friends who are interested in PHP tutorials.