php - SSL3_GET_SERVER_CERTIFICATE :certificate verify failed using xampp on mac

标签 php laravel ssl xampp

希望大家一切顺利。使用 laravel 创建新项目时出现 SSL 错误。这是我的错误:

[Composer\Downloader\TransportException]                                     
  The "http://packagist.org/p/laravel/laravel$745fa4e5f0a1485878f0b4c5be5cf26  
  a9e5d68243751f3c34acbd8bf3766065d.json" file could not be downloaded: SSL o  
  peration failed with code 1. OpenSSL Error messages:                         
  error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify   
  failed                                                                       
  Failed to enable crypto                                                      
  failed to open stream: operation failed  

对于这个问题,我尝试了多种解决方案,但结果仍然为零。我想分享一种用于 SSL 问题的方法。我得到了一些网站下面的方法,在 php.ini 文件中添加下面代码的人指南在哪里。

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo ="/Applications/XAMPP/xamppfiles/etc/cacert.pem"

[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="/Applications/XAMPP/xamppfiles/etc/cacert.pem"

但是这个方法也行不通。谁能帮我解决这个问题。谢谢

最佳答案

运行该命令并解决你的问题,我自己修复了它

curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer 

我也在使用 PHP 5.6.24 的 MacOs sierra

关于php - SSL3_GET_SERVER_CERTIFICATE :certificate verify failed using xampp on mac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42097303/

相关文章:

php - 使用 CodeIgniter 下载 CSV 结果

laravel - 如何在不通知的情况下测试 Laravel 通知?

php - Laravel:在自定义登录中集成 Throttle

ssl - 如何让 Jetty 9 在访问 keystore 时忽略 keepass?

ssl - Mac 上的 Safari 有 SSL 证书问题,其他浏览器没问题

php - 如何更改查询中的 Mysql 变量?

php - Mysql选择按日期字段的一部分分组

php - WordPress 无法加载(连接超时)

laravel - 在 Laravel 4 中运行测试会产生 "Unknown method User::save()"

ssl - Jenkins svn collabnet 构建失败