【问题标题】:Fatal error: Out of memory when executing composer require cboden/ratchet on symfony project致命错误:在 symfony 项目上执行 composer require cboden/ratchet 时内存不足
【发布时间】:2018-12-23 16:56:06
【问题描述】:

在安装 Ratchet 软件包时,我最终得到了我们的内存错误。

当安装了很多包时,这显然会成为一个问题,但是我的项目中只安装了几个库(如 jquery、bootstrap 和 jqueryui)。

我也看不懂之前的消息(VirtualFree(): Attempt to access invalid address. and others from this kind)。

我对作曲家和 symfony 的基本知识有点陌生,所以我不明白可能是什么问题。

这是我的错误(这是第一次尝试安装,项目版本是Symfony 3.4.14 (kernel: app, env: dev, debug: true)):

Using version ^0.4.1 for cboden/ratchet
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.


VirtualAlloc() failed: [0x00000008] Not enough memory resources are available to process this command.


VirtualFree() failed: [0x000001e7] Attempt to access invalid address.

PHP Fatal error:  Out of memory (allocated 975175680) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Fatal error: Out of memory (allocated 975175680) (tried to allocate 4096 bytes) in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

【问题讨论】:

    标签: php symfony composer-php ratchet


    【解决方案1】:

    这已成为一个相当普遍的问题,不一定与 Ratchet 软件包有关。虽然它可能不是正确的解决方案,但我解决问题的方法是简单地删除 PHP 内存限制。

    您首先需要找到您的 php.ini 文件,其位置因您的设置而异,然后编辑以下行:

    memory_limit = 128M 并将其更改为 memory_limit = -1

    有任何问题请告诉我。

    【讨论】:

    • 如果您在查找 php.ini 文件时需要帮助,请告诉我。
    • 感谢您的回答 :) 虽然我只是将 128M 乘以 2 到 256M,但它确实很有帮助,因为 -1(无限制)我认为它会有风险,但它仍然适用于 256M。非常有用的建议。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-01
    • 2014-01-25
    • 2011-10-16
    • 1970-01-01
    相关资源
    最近更新 更多