安装 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。
关于php - 如何解决 Laravel 安装上 MAC OS 上的 curl 证书问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29792786/