Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

前端 未结 21 1238
猫巷女王i
猫巷女王i 2020-11-21 22:14

This error message is being presented, any suggestions?

Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

相关标签:
21条回答
  • 2020-11-21 23:05

    wordpress users add line:

    @ini_set('memory_limit', '-1');

    in wp-settings.php which you can find in the wordpress installed root folder

    0 讨论(0)
  • 2020-11-21 23:05

    I hadn't renewed my hosting and the database was read-only. Joomla needed to write the session and couldn't do it.

    0 讨论(0)
  • It is unfortunately easy to program in PHP in a way that consumes memory faster than you realise. Copying strings, arrays and objects instead of using references will do it, though PHP 5 is supposed to do this more automatically than in PHP 4. But dealing with your data set in entirety over several steps is also wasteful compared to processing the smallest logical unit at a time. The classic example is working with large resultsets from a database: most programmers fetch the entire resultset into an array and then loop over it one or more times with foreach(). It is much more memory efficient to use a while() loop to fetch and process one row at a time. The same thing applies to processing a file.

    0 讨论(0)
提交回复
热议问题