Cygwin PHP (all available versions) has a hard 4MB memory limit
Fri Jul 17 21:39:49 GMT 2020

Hi there,

Recently I've noticed that PHP seems have to hard 4MB memory limit, even when overridden in the settings. For whatever reason the bundled PHP versions with Cygwin have this problem.

The failing message is `Out of memory` which indicates PHP thinks the system has exhausted all RAM (the usual out of memory message is "Fatal error: Allowed memory size of XXX bytes exhausted" when you hit the cap).

If I compile a fresh PHP from source (for example 7.4.8) it works absolutely fine.

I've reproduced this on another PC with a fresh install of Cygwin only installing the base PHP as the only extra package.

Example script:

echo ini_get('memory_limit'), "\n";

file_get_contents(''); // A large file such as an ISO.

$ php test.php
PHP Fatal error:  Out of memory (allocated 4194304) (tried to allocate 2097184 bytes) in /c/Users/JackBlower/tmp-safe/test.php on line 5

Any help would be great thanks.

Many Thanks,


More information about the Cygwin mailing list