On 2020-07-17 15:39, km2z7kca0oge--- via Cygwin wrote: > 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) > https://github.com/php/php-src/tree/php-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: > <?php > echo ini_get('memory_limit'), "\n"; > file_get_contents('http://mirror.cwcs.co.uk/centos/8.2.2004/isos/x86_64/CentOS-8.2.2004-x86_64-dvd1.iso'); > // A large file such as an ISO. > > Output: > $ php test.php > 128M > 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.
You told us nothing about what versions of Windows, Cygwin, and PHP you are running, so WAG, either: - you have defaulted to or specified a PHP configuration limit of 4MB memory for PHP tasks, or - if you're running 32 bit Cygwin, possibly under 32 bit Windows, you have probably run out of heap space from installing too many packages requiring too many DLLs. If you are running something else, you need to tell us about those, following the problem reporting guidelines linked below, including copying verbatim all error messages seen, and PHP build configurations and logs. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in IEC units and prefixes, physical quantities in SI.] -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple