dongshao8566 2014-11-10 18:20
浏览 221
已采纳

laravel composer update耗尽内存

I am trying to update laravel repository using 'php composer.phar update' command. But I am getting this error -

- Removing symfony/translation (v2.4.8)
PHP Fatal error:  Uncaught exception 'ErrorException' with message 'proc_open():
 fork failed - Cannot allocate memory' in phar:///var/www/fyc/composer.phar/vend
or/symfony/console/Symfony/Component/Console/Application.php:983

I came across links which told to disable 'xdebug' to solve this problem but its nowhere installed on my system. I am using Ubuntu 14.04, PHP 5.5.18, Zend 2.5.0. The links are -

How to disable XDebug

https://github.com/composer/composer/issues/1898 (read last 15 days comments)

Update: I know that the error says that memory is less but I saw some threads which said that allocating even upto 7GB doesn't work & their system gets hung. So, I am looking for an alternative solution. My server is on AWS free tier eligible EC2 instance. Don't know how much memory it gives for RAM.

  • 写回答

2条回答 默认 最新

  • douzong2206 2014-11-10 18:48
    关注

    I found out that some things can solve this problem -

    1) Update your PHP version. Versions prior to 5.4.19 don't work I think. But just keep it to the latest.

    2) Disable/Comment 'xdebug' in your php.ini file if its present. A link to disable it is present in the question.

    3) If non of the above works then try this one. This worked for me finally after wasting an hour or so.

    rm -rf vendor/
    
    rm -rf composer.lock
    
    php composer install --prefer-dist
    

    4) Rollback to a previous version of composer. It worked for some people. This might be a temporary solution ( because you definitely want to upgrade in future).

    5) This one was killer. This one also worked You can create a SWAP memory using your hard disk. This means that memory in hard disk will be used as additional RAM but the access to it would be slower (just like normal hard disk access). This is more useful for EC2 instance users who have very less RAM. More information for this is here -

    https://github.com/composer/composer/issues/945#issuecomment-12548720

    http://www.the-tech-tutorial.com/adding-swap-to-any-ec2-instance/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题