php warning: directive,安装Composer PHP Warning: copy(): SSL operation failed with code

报错信息

[root@localhost ~]# 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

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

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

Warning: copy(https://install.phpcomposer.com/installer): failed to open stream: operation failed in Command line code on line 1

1

2

3

4

5

6

7

8

9

10

11

12

解决方法

应该是CA证书验证失败造成的错误,下载个CA证书

[root@localhost ~]# wget http://curl.haxx.se/ca/cacert.pem

[root@localhost ~]# mv cacert.pem /usr/local/openssl/ssl/certs/cacert.pem

[root@localhost ~]# vim /yourpath/php.ini

1

2

3

修改cafile路径,保存

[openssl]

; The location of a Certificate Authority (CA) file on the local filesystem

; to use when verifying the identity of SSL/TLS peers. Most users should

; not specify a value for this directive as PHP will attempt to use the

; OS-managed cert stores in its absence. If specified, this value may still

; be overridden on a per-stream basis via the "cafile" SSL stream context

; option.

;openssl.cafile=

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

---------------------

作者:TricSuMer

来源:CSDN

原文:https://blog.csdn.net/u010546138/article/details/76714019

版权声明:本文为博主原创文章,转载请附上博文链接!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值