本文介绍了PHP Composer更新“不能分配存储器”错误(使用Laravel 4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是无法解决这个问题。



我在Linode 1G RAM基本计划。尝试通过Composer安装包,它不让我。我的内存限制在PHP.ini上设置为-1



还有其他什么可以做到这一点吗?

 加载包信息的composer存储库
更新依赖关系(包括require-dev)
- 安装thujohn / rss(dev-master df80a7d)
下载:100%
PHP致命错误:在phar:/// usr / local / bin / composer / vendor / symfony中出现消息proc_open():fork failed - 无法分配内存 /console/Symfony/Component/Console/Application.php:975
堆栈跟踪:
#0 [internal function]:Composer\Util\ErrorHandler :: handle(2,'proc_open(): fo ...','phar:/// usr / loc ...',975,Array)
#1 phar:/// usr / local / bin / composer / vendor / symfony / console / Symfony /Component/Console/Application.php(975):proc_open('stty -a | grep ...',Array,NULL,NULL,NULL,Array)
#2 phar:/// usr / local / bin / composer / vendor / symfony / console / Symfony / Component / Console / Application.php(853):Symfony \Component\Console\Application-> getSttyColumns()
#3 phar:/// usr / local / bin / composer / vendor / symfony / console / Symfony / Component / Console / Application.php(818):Symfony \Component\Console\Application-> getTerminalDimensions()
#4 phar :///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752):Symfony\Component\Console\Application-> getTerminalWidth()
#5 phar:/// usr / local / bin / com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975

致命错误:在phar:/// usr / local / bin / composer / vendor / symfony / console / Symfony中发生消息'proc_open():fork failed - 无法分配内存'的未捕获异常'ErrorException' /Console/Application.php:975
堆栈跟踪:
#0 [内部函数]:Composer\Util\ErrorHandler :: handle(2,'proc_open():fo ...' 'phar:/// usr / loc ...',975,Array)
#1 phar:/// usr / local / bin / composer / vendor / symfony / console / Symfony / Component / .php(975):proc_open('stty -a | grep ...',Array,NULL,NULL,NULL,Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php (853):Symfony \Component\Console\Application-> getSttyColumns()
#3 phar:/// usr / local / bin / composer / vendor / symfony / console / Symfony / Component / Console /Application.php(818):Symfony \Component\Console\Application-> getTerminalDimensions()
#4 phar:/// usr / local / bin / composer / vendor / symfony / console / Symfony /Component/Console/Application.php(752):Symfony \Component\Console\Application-> getTerminalWidth()
#5 phar:/// usr / local / bin / com in phar: //usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975



$

b $ b

此外,您应该提交composer.lock文件,并在较少资源密集的生产环境中进行作曲家安装。



更多详细信息:


I just can't solve this one.

I'm on Linode 1G RAM basic plan. Trying to install a package via Composer and it's not letting me. My memory limit is set to "-1" on PHP.ini

Is there anything else I can do to get this installed?

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing thujohn/rss (dev-master df80a7d)
    Downloading: 100%
PHP Fatal error:  Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:975
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 975, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(975): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(853): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(818): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975

Fatal error: Uncaught exception 'ErrorException' with message 'proc_open(): fork failed - Cannot allocate memory' in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:975
Stack trace:
#0 [internal function]: Composer\Util\ErrorHandler::handle(2, 'proc_open(): fo...', 'phar:///usr/loc...', 975, Array)
#1 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(975): proc_open('stty -a | grep ...', Array, NULL, NULL, NULL, Array)
#2 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(853): Symfony\Component\Console\Application->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(818): Symfony\Component\Console\Application->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752): Symfony\Component\Console\Application->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975
解决方案

A bit old but just in case someone new is looking for a solution, updating your PHP version can fix the issue.

Also you should be committing your composer.lock file and doing a composer install on a production environment which is less resource intensive.

More details here:https://github.com/composer/composer/issues/1898#issuecomment-23453850

这篇关于PHP Composer更新“不能分配存储器”错误(使用Laravel 4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 05:52