安裝composer 提示PHP Warning: copy(): SSL operation failed with code 1. OpenSSL Error messages:


問題描述

#php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"

PHP Warning:  copy(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in Command line code on line 1
PHP Warning:  copy(): Failed to enable crypto in Command line code on line 1
PHP Warning:  copy(https://install.phpcomposer.com/installer): failed to open stream: operation failed in Command line code on line 1

解決方法

下載證書http://curl.haxx.se/ca/cacert.pem 
wget http://curl.haxx.se/ca/cacert.pem
或者使用網頁下載再上傳至linux
mkdir -p /usr/local/openssl/ssl/certs/
mv cacert.pem /usr/local/openssl/ssl/certs/cacert.pem

修改php.ini

;openssl.capath=
openssl.cafile=/usr/local/openssl/ssl/certs/cacert.pem

問題解決
重新安裝composer即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM