簡體   English   中英

如何在Laravel安裝上解決MAC OS上的卷曲證書問題?

[英]How to solve the curl certificate issue on MAC OS on Laravel installation?

在安裝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。

在Macosx curl可以在cacert.pem中安全下載:

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

有關CA文件引導的更多信息

brew info openssl

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM