composer install 问题 Failed to download lcobucci/jwt from dist

问题描述

[webadm@iZwz9g546trqlkooc4y8b2Z bsm-web]$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 2 installs, 0 updates, 0 removals
  - Installing lcobucci/jwt (3.2.2): Downloading (failed)    Failed to download lcobucci/jwt from dist: The "https://files.phpcomposer.com/files/lcobucci/jwt/0b5930be73582369e10c4d4bb7a12bac927a203c.zip" file could not be downloaded (HTTP/1.1 405 Not Allowed)
    Now trying to download from source
  - Installing lcobucci/jwt (3.2.2): Cloning 0b5930be73


  [RuntimeException]                                                                                        
  Failed to clone https://github.com/lcobucci/jwt.git via https, ssh protocols, aborting.                   

  - https://github.com/lcobucci/jwt.git                                                                     
    error:  while accessing https://github.com/lcobucci/jwt.git/info/refs                                   

    fatal: HTTP request failed                                                                              

  - git@github.com:lcobucci/jwt.git                                                                         
    Warning: Permanently added the RSA host key for IP address '13.229.188.59' to the list of known hosts.  
    Permission denied (publickey).                                                                          
    fatal: The remote end hung up unexpectedly                                                              


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

不知为何,安装不了jwt的依赖,改成国内的镜像源也没用,所以直接安装jwt

composer require lcobucci/jwt

然后又报了下面的错误

Using version ^3.2 for lcobucci/jwt
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing lcobucci/jwt (3.2.2): Loading from cache
    proc_open(): fork failed - Cannot allocate memory
    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details


Warning: proc_open(): fork failed - Cannot allocate memory in phar:///usr/local/bin/composer/vendor/symfony/console/Application.php on line 959

  [ErrorException]                                   
  proc_open(): fork failed - Cannot allocate memory  


require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

根据问题描述可能是内存原因,maybe是没有给composer配置内存?

运行下面这几条命令后问题解决

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1

参考网址
https://blog.csdn.net/darry_zhao/article/details/52791568

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值