On virtual hosting, a certain amount of RAM is allocated for each tariff, for processing each PHP script , the parameter responsible for this is called memory_limit.
As soon as one of the scripts exhausts all the memory allocated to it on its tariff, the site displays an error like this:
Fatal error: Allowed memory size of N bytes exhausted (tried to allocate X bytes) in /var/www/ch0ce12345/www/site.com/script.php on line 28
The main reason for the appearance of such an error is that the script was initially resource-demanding to perform any operations on the site, or due to general non-optimization began to consume more resources.
Solution options:
- Change the value of memory_limit in the PHP parameters to a higher one, if the minimum value was specified;
- Changes to the PHP version ;
- Changing the tariff , where the RAM value is higher *;
- Optimization of site scripts ;
- Temporary activation of booster3000 for one-time operations.
* - changing the tariff plan in this case can act as a temporary solution, i.e. it deals with the consequences, and not with the main cause of the error
All question categories