PHP内存不足错误不反映php.ini中的memory_limit设置 [英] PHP out of memory error does not reflect memory_limit setting in php.ini

查看:351
本文介绍了PHP内存不足错误不反映php.ini中的memory_limit设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用Composer客户端将软件包安装到Contao时,出现错误:

When I try to install a package to Contao using the Composer client I get an error:


致命错误:允许的内存大小为在第220行上的phar:// D:/wamp/www/myproject/composer/composer.phar/src/Composer/DependencyResolver/Solver.php中的1073741824字节用尽了(试图分配134217728字节)

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 134217728 bytes) in phar://D:/wamp/www/myproject/composer/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220

真的感到困惑。我的PHP内存限制设置为512M。 phpinfo()确认。但是1073741824是千兆字节!而且还远远不够,就好像脚本完全无视PHP内存限制(在哪里?),甚至1 GB的内存都不足够!?!?

I am really confused. My PHP memory limit is set at 512M. phpinfo() confirms it. But 1073741824 is a gigabyte! And it still isn't enough, as if the script totally disregards the PHP memory limit (where?) and even a gigabyte isn't enough!?!?

什么我可不可以做?我读到有关RLimitMEM的信息,但在WAMPServer的任何地方都找不到这样的设置。

What can I do? I read about RLimitMEM, but I can not find such a setting anywhere on WAMPServer.

推荐答案

我找到了答案。

我在项目中搜索了 memory_limit ,发现作曲者客户端试图在<$ c $中设置内存限制c> system / modules /!composer / src / Runtime.php 这行是: @ini_set('memory_limit','1024M'); 我将其更改为 @ini_set('memory_limit','2048M'); 本质上将可用内存加倍,并且可以正常工作。

I searched the project for memory_limit and found out, that the composer client attempts to set a memory limit in system/modules/!composer/src/Runtime.php There is this line: @ini_set('memory_limit', '1024M'); I changed it to @ini_set('memory_limit', '2048M'); essentially doubling the available memory, and it worked.

这篇关于PHP内存不足错误不反映php.ini中的memory_limit设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆