代码之家  ›  专栏  ›  技术社区  ›  mafortis

CentO不会增加内存限制

  •  1
  • mafortis  · 技术社区  · 5 年前

    我有使用CentOs 7和CyberPanel的VPS,当我尝试使用 composer install 我得到这个错误

    PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 268435456 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
    
    Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 268435456 bytes) in phar:///usr/bin/composer/src/Composer/DependencyResolver/Solver.php on line 223
    
    Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
    

    屏幕截图

    one

    two

    知道吗?

    2 回复  |  直到 5 年前
        1
  •  0
  •   Nicolai Fröhlich    5 年前

    找到正确的 php.ini 对于PHP CLI SAPI,请使用以下命令:

    php -i | grep 'ini'
    

    添加 memory_limit = -1 使用文本编辑器将此文件。

    您还可以通过以下方式增加一个命令的内存限制:

    COMPOSER_MEMORY_LIMIT=-1 composer update
    

    …或者。。。

    php -d memory_limit=-1 /user/bin/composer update
    
        2
  •  -1
  •   mafortis    5 年前

    解决了的

    我使用了这个命令,我的作曲家开始运行

    which composer
    

    找到我的作曲家之路,然后

    php -d memory_limit=-1 /user/bin/composer update