php.exe (WAMP) 不能分配超过 1G 的内存,即使内存_limit设置为 -1 也是如此



几天后,我无法使用Composer更新我的Symfony项目,因为我的WAMP安装中的php.exe进程无法分配超过1G的内存...我不记得在我的PHP设置中做了任何更改。

在 php.ini(是的,正确的(中,我将memory_limit设置为 -1。我的作曲家诊断全部设置为"正常"。

  • 我的 PHP 版本是 5.6.18
  • 我的WAMP版本是3.1.3
  • 我的操作系统是Windows 7
  • 我的作曲家版本是 1.6.5

它可能来自Windows设置吗?

这是我收到的错误消息:

Fatal error: Out of memory (allocated 1397751808) (tried to allocate 268435456 bytes) in phar://C:/wamp/www/DESiwid/composer.phar/src/Composer/DependencyResolver/Solver.php on line 220
Segmentation fault

我在编码分配的 PHP 测试独立脚本中遇到了相同的错误:

set memory_limit to 810M
memory limit is 810M
try allocating 800 megabyte...pass.Usage: 800.5 Peak: 800.5
memory_limit (get value):849346560
set memory_limit to 860M
memory limit is 860M
try allocating 850 megabyte...pass.Usage: 850.5 Peak: 850.5
memory_limit (get value):901775360
set memory_limit to 910M
memory limit is 910M
try allocating 900 megabyte...pass.Usage: 900.5 Peak: 900.5
memory_limit (get value):954204160
set memory_limit to 960M
memory limit is 960M
try allocating 950 megabyte...
Fatal error: Out of memory (allocated 262144) (tried to allocate 996147201 bytes
) in C:wampwww_testmemory.php on line 5

好的,我找到了一个解决方案:我使用的是WAMP 32位,并切换到WAMP 64位,解决了所有问题。

最新更新