Error "Fatal error: Allowed memory size"Means that the script exceeded the PHP parameter value during its operation memory_limit current tariff plan.
Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) in /home/example/example.com/www/path/to/script.php on line Z
X
- available memory size, specified by the PHP parameter memory_limit, in bytes.Y
- the amount of memory that the script tried to use in excess of the available amount at the time of the error, in bytes./home/example/example.com/www/path/to/script.php
- full path to the script, during the execution of which an error occurred.Z
- line number in the script where the error occurred.X
+ Y
is not required value memory_limit, insofar as Y
shows the amount of memory that was not enough at the time of the abnormal termination of the script, and in the case of further work, the script may require a much larger amount of memory.
Most often, the error occurs in the following situations:
The solution to the problem might be:
Note for WordPress: if the size of the actually allocated memory (value X
) is less than PHP value memory_limit of the used tariff plan, it is necessary to file wp-config.php add line:
define('WP_MEMORY_LIMIT', 'xxxM');
Where xxx
- value memory_limit tariff plan.