windows composer更新提示权限问题

本文着重记录问题1在windows的解决方案:

...file_put_contents(/home/vagrant/.composer/cache/repo/https---packagist.laravel-china.org/packages.json)..

在错误提示的目录里,删除https--- ... 文件夹 重新update即可

1#权限错误

file_put_contents(/home/vagrant/.composer/cache/repo/https---packagist.laravel-china.org/packages.json): failed to open stream: Permission denied
https://packagist.laravel-china.org could not be fully loaded, package information was loaded from the local cache and may be out of date

解决方法:sudo chown -R $USER ~/.composer/

2# zlib_decode():data error

Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info

解决方法 更换composerrepo.packagist

3# SSL routines:ssl3_get_server_certificate:certificate verify failed

  • 错误描述
- Installing phpunit/phpunit (6.5.8): Downloading (failed)
Downloading (failed)
Downloading (failed)    Failed to download phpunit/phpunit from dist: The "https://files.phpcomposer.com/files/sebastianbergmann/phpunit/4f21a3c6b97c42952fd5c2837bb354ec0199b97b.zip" 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
    Now trying to download from source
  • 解决方案
In my case, it was the CA Cert file that was the culprit
Open terminal and run php -r "var_dump(openssl_get_cert_locations());"
Note the location of default_cert_file. It might say \usr\local\ssl\cert.pem
Verify that that file exists. If not, download the cacert.pem file from https://curl.haxx.se/ca/cacert.pem and place it in somewhere preferably in /usr/local/ssl
You now have a file is usr/local/ssl/cacert.pem
Open your php.ini and add the location of the file openssl.cafile=cacert.pem
Run composer config --global cafile "/usr/local/ssl/cacert.pem"

If it's of any use to others, I use valet+ 1.0.26, composer 1.8.4 OSX Movajes 10.14.3, php7.3 and simply specifying the cert composer looks for with:
composer config --global cafile "/usr/local/etc/openssl/cert.pem"
复制代码
composer config --global cafile "C:/AMP_ENV/php-7.1.15/ca/cacert.pem"
composer config --global --list

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值