While executing composer install/update I have got the following error from openssl:
The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed 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
I am using:
composer diag shows:
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity: FAIL
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Checking disk free space: OK
Checking composer version:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
php -r 'var_dump(openssl_get_cert_locations());' shows:
array(8) {
["default_cert_file"]=>
string(33) "/opt/lampp/share/openssl/cert.pem"
["default_cert_file_env"]=>
string(13) "SSL_CERT_FILE"
["default_cert_dir"]=>
string(30) "/opt/lampp/share/openssl/certs"
["default_cert_dir_env"]=>
string(12) "SSL_CERT_DIR"
["default_private_dir"]=>
string(32) "/opt/lampp/share/openssl/private"
["default_default_cert_area"]=>
string(24) "/opt/lampp/share/openssl"
["ini_cafile"]=>
string(0) ""
["ini_capath"]=>
string(0) ""
}
For php 5.5.19 everything is Ok.
Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer. json via rm -rf vendor && composer update -v when troubleshooting, excluding any possible interferences with existing vendor installations or composer.
To update your packagesNavigate to the root of your git repo, where your composer. json file is. Run composer update (on your local machine) to update the required packages and re-generate a composer.
Use the format “128M” for megabyte or “2G” for gigabyte. You can use the value “-1” to ignore the memory limit completely. Another way would be to increase the PHP memory limit: php -d memory_limit=512M composer.
php composer.phar install --prefer-dist All the packages will be refreshed by composer using the cached versions if they are the latest. Now check and see if your problem is resolved by checking your package versions. You should also test a php composer.phar update after this when a new package update is available, and see if it works.
Private Packagist is fully compatible with both Composer versions 1 and 2, you do not need to make any changes to your Private Packagist configuration when upgrading to Composer 2.0. In order to upgrade to a current preview release of Composer 2.0 you need to run the following command:
In order to reinstall packages using composer, you can do the following: Step 1: Backup your vendor folder under your app root, and delete all files in the vendor folder, except .gitignore if it exists. Step 2: Backup your composer.lock file on your app root, and delete it. Step 3: Run the following command from your app root.
In order to upgrade to a current preview release of Composer 2.0 you need to run the following command: composer.phar self-update --2 If you want to switch back to version 1 you can either use composer self-update --rollback right afterwards or composer self-update --1 at any any later point.
I found a solution to this
I'm running:
FreeBSD 10.1
Apache2.4
PHP 5.6.3
To find the CA file I ran this command
> locate cacert.pem
Result was:
/usr/local/lib/perl5/site_perl/5.16/Mozilla/CA/cacert.pem
Then open the php.ini file and
change this:
;openssl.cafile=
To this:
openssl.cafile=/usr/local/lib/perl5/site_perl/5.16/Mozilla/CA/cacert.pem
Note: This directive is only available on php 5.6.x
Then restart Apache
I am using Mac OS Sierra and when I was trying to update the composer using the command /usr/local/bin/composer self-update
I kept getting the error:
[Composer\Downloader\TransportException]
The "https://getcomposer.org/version" file could not be downloaded: SSL operation failed with co
de 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
I fixed it following these steps:
1) Create the local database using the command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
2) Locate the cert file:
locate cacert.pem
3) Check the location of the php.ini file:
php --ini
4) If the 'Loaded Configuration File' for php.ini
file is showing as (none)
, copy the file /etc/php.ini.default
to /etc/php.ini
:
sudo cp /etc/php.ini.default /etc/php.ini
5) Open the php.ini
file and edit the ;openssl.cafile=
line by uncommenting it and appending the link to the cert file location:
openssl.cafile=/Users/me/.composer/cacert.pem
Thats it. Now, when you run the composer update, it will work fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With