php – 如何在Laravel安装上解决MAC OS上的卷曲证书问题?

在安装Laravel时

$composer global require "laravel/installer=~1.1"

得到这个错误

The "https://packagist.org/packages.json" file Could not be downloaded: no valid certs found cafile stream: `/usr/local/etc/openssl/cert.pem'
Failed to enable crypto
Failed to open stream: operation Failed
https://packagist.org Could not be fully loaded, package information was loaded from the local cache and may be out of date

更新:

命令composer self-update也会引发以下错误

[Composer\Downloader\TransportException]                                                                                               
  The "https://getcomposer.org/version" file Could not be downloaded: no valid certs found cafile stream: `/usr/local/etc/openssl/cert.  
  pem'                                                                                                                                   
  Failed to enable crypto                                                                                                                
  Failed to open stream: operation Failed  

我在OSX 10.9.5中使用XAMPP5.6.3(xampp-osx-5.6.3-0-installer)

我从curl下载了证书但没有工作.

解决方法:

问题解决了:

1)下载证书文件(使用wget下载很重要,因为复制粘贴html文件对我不起作用)

$brew install wget
wget http://curl.haxx.se/ca/cacert.pem

2)复制文件并粘贴到以下目录(确保有读写权限)

/Applications/XAMPP/xamppfiles/share/openssl/cacert.pem

3)将以下行添加PHP.ini

openssl.cafile=/Applications/XAMPP/xamppfiles/share/openssl/cacert.pem

4)重启Apache

5)运行命令composer global require“laravel / installer = ~1.1”将安装Larvel.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...