Reputation: 3097
While installing Laravel
$ composer global require "laravel/installer=~1.1"
Getting this error
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
UPDATE:
Also the command composer self-update
throws the following error
[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
I am using XAMPP5.6.3 (xampp-osx-5.6.3-0-installer) with OSX 10.9.5
I downloaded the certificate from curl but not working.
Upvotes: 3
Views: 12960
Reputation: 129
On Macosx curl is fine to download safely in 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
More about CA file bootstrapping
brew info openssl
Upvotes: 3
Reputation: 3097
Issue solved:
1) Download the certificate file like (It is important to download using wget because copy paste the html file was not working for me)
$ brew install wget
wget http://curl.haxx.se/ca/cacert.pem
2) Copy the file and paste to the following directory (Make sure the read write permission is there)
/Applications/XAMPP/xamppfiles/share/openssl/cacert.pem
3)Add the following line to php.ini
openssl.cafile=/Applications/XAMPP/xamppfiles/share/openssl/cacert.pem
4) Restart the Apache
5) Running the command composer global require "laravel/installer=~1.1"
will install the Larvel.
Upvotes: 10