1
Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 145460 bytes) in /home/legalvis/public_html/wolfpack/vendor/composer/ClassLoader.php on line 411

I've got this error when trying to execute a rather large script. I've tried a few things:

  1. Putting ini_set('memory_limit', '3G'); almost everywhere in my code (including ClassLoader.php)
  2. Checking my php.ini file

When I do a php -i or phpinfo(); the allowed size is 3G.

My script is working perfectly locally, but on the server despite the configuration it seems to be failing.

Any idea?

Vico
  • 1,554
  • 1
  • 23
  • 53
  • Possible duplicate of [Allowed memory size of 262144 bytes exhausted (tried to allocate 24576 bytes)](http://stackoverflow.com/questions/16175153/allowed-memory-size-of-262144-bytes-exhausted-tried-to-allocate-24576-bytes) – xkcd149 Mar 03 '16 at 05:27

1 Answers1

2
Try this: ini_set('memory_limit','3072M');
Peeje
  • 445
  • 2
  • 9
  • That's weird. But it's working. Don't know why it was not working at the beginning, and why it's working now. But thanks! – Vico Mar 03 '16 at 05:44