Fatal Error: Out of Memory, But I Do Have Plenty of Memory (Php)

PHP out of memory error even though memory_limit not reached

I have finally found the answer. The clue came from pcguru's answer beginning 'Since the server has only 1 GB of RAM...'.

On a hunch I looked to see whether Apache had memory limits of its own as those were likely to affect PHP's ability to allocate memory. Right at the top of httpd.conf I found this statement: RLimitMEM 204535125

This is put there by whm/cpanel. According to the following webpage whm/cpanel incorrectly calculates its value on a virtual server...
http://forums.jaguarpc.com/vps-dedicated/17341-apache-memory-limit-rlimitmem.html

The script that runs out of memory gets most of the way through, so I increased RLimitMEM to 268435456 (256 MB) and reran the script. It completed its array merge and produced the csv file for download.

ETA: After further reading about RLimitMEM and RLimitCPU I decided to remove them from httpd.conf. This allows ini_set('memory_limit','###M') to work, and I now give that particular script the extra memory it needs. I also doubled the RAM on that server.

Thank you to everyone for your help in detecting this rather thorny issue, and especially to pcguru who came up with the vital clue that got me to the solution.

Composer & Symfony - Fatal error: Out of memory

I solved my issue.

  • Backup website files in local
  • Install Wamp and run the servers
  • Increase memory limit to 2G
  • Make the composer update
  • Upload the files to the production server

I'm very confusing about composer and its requirements. It's crazy...

how to solve PHP Fatal error: Out of memory, when I try this command composer require laravel/ui for auth file.?

You can try installing this package that enables parallelization of the downloads.

composer global require hirak/prestissimo

Also when running your composer command use the -vvv flag if you are running into issues.

  composer require laravel/ui -vvv

PHP out of memory error does not reflect memory_limit setting in php.ini

I found the answer.

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.



Related Topics



Leave a reply



Submit