PHP Composer update quot;cannot allocate memoryquot; error (using Laravel 4)(PHP Composer 更新“无法分配内存错误(使用 Laravel 4))
问题描述
我就是解决不了这个问题.
I just can't solve this one.
我正在使用 Linode 1G RAM 基本计划.试图通过 Composer 安装一个包,它不让我.我的内存限制在 PHP.ini 上设置为-1"
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]: ComposerUtilErrorHandler::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): SymfonyComponentConsoleApplication->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(818): SymfonyComponentConsoleApplication->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752): SymfonyComponentConsoleApplication->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]: ComposerUtilErrorHandler::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): SymfonyComponentConsoleApplication->getSttyColumns()
#3 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(818): SymfonyComponentConsoleApplication->getTerminalDimensions()
#4 phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php(752): SymfonyComponentConsoleApplication->getTerminalWidth()
#5 phar:///usr/local/bin/com in phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php on line 975
推荐答案
有点老了,但以防万一新人正在寻找解决方案,更新您的 PHP 版本可以解决问题.
A bit old but just in case someone new is looking for a solution, updating your PHP version can fix the issue.
您还应该提交您的 composer.lock 文件并在资源密集型较少的生产环境中安装 composer.
Also you should be committing your composer.lock file and doing a composer install on a production environment which is less resource intensive.
更多细节在这里:https://github.com/composer/composer/issues/1898#issuecomment-23453850
这篇关于PHP Composer 更新“无法分配内存"错误(使用 Laravel 4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP Composer 更新“无法分配内存"错误(使用 Laravel 4)
基础教程推荐
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01