如何解决在Laravel安装Mac OS上卷曲证书问题?

问题描述 投票:3回答:2

在安装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  

我使用XAMPP5.6.3(XAMPP-OSX-5.6.3-0安装程序)与OSX 10.9.5

我下载了卷曲,但不工作的证书。

php macos laravel curl composer-php
2个回答
6
投票

问题解决:

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)运行命令qazxsw POI将安装Laravel。


0
投票

MacOSX上卷曲罚款在cacert.pem安全地下载:

composer global require "laravel/installer=~1.1"

更多关于CA文件引导

echo "Downloading cacert.pem..."
curl -sSL http://curl.haxx.se/ca/cacert.pem >> cacert.pem
mkdir -p /usr/local/etc/openssl/certs
mv -v cacert.pem /usr/local/etc/openssl/certs
© www.soinside.com 2019 - 2024. All rights reserved.