cancel
Showing results for 
Search instead for 
Did you mean: 

Fatal error: Allowed memory size of xx bytes exhausted (tried to allocate xx bytes) in /home/...php

Fatal error: Allowed memory size of xx bytes exhausted (tried to allocate xx bytes) in /home/...php

Hi, I'm new to Magento. Please help me with the above error which I am getting when I try to save a product. Magento ver. 1.9.3.7 Thanks.

3 REPLIES 3

Re: Fatal error: Allowed memory size of xx bytes exhausted (tried to allocate xx bytes) in /home/...

Hi @xasha_g

 

The cause is because PHP has exhausted the maximum memory limit as set by the configuration value memory_limit.

 

Typically this PHP configuration value has a very low default of 8MB or 16MB.

 

The Magento documentation recommends at least 64MB, however even this value can fall short on certain script executions.

 

Increasing this value can be done either by asking your host to increase the global memory_limit in the servers php.ini configuration file. Another option is to increase this via .htaccess file.

 

Magento comes with a default .htaccess file in the root directory that includes this

 

configuration directive.

 

php_value memory_limit 64M
php_value max_execution_time 18000

 

You can simply change this value from 64MB to 256M or 512MB depending on your needs.

so it should be like below : 

 

php_value memory_limit 512Mphp_value max_execution_time 18000

This value should be kept to the minimum necessary to run your application.

 

Hope it helps

if issue solved,Click Kudos & Accept as Solution

Re: Fatal error: Allowed memory size of xx bytes exhausted (tried to allocate xx bytes) in /home/...

Hi,

 

Thanks so much for your help. I tried that - this limit was 256M in the .htaccess file. I changed this to 512M, but am still getting this error. Any ideas?

Thanks again.

Re: Fatal error: Allowed memory size of xx bytes exhausted (tried to allocate xx bytes) in /home/...

Hello @xasha_g,

 

1 check current limit:
(in my os)php -i | grep limit => memory_limit => 256M => 256M

 

2 locate php.ini
php --ini =>
Configuration File (php.ini) Path: /etc
Loaded Configuration File: /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed: /etc/php.d/curl.ini

3 change memory_limit in php.ini
vi /etc/php.ini
memory_limit = 512M

4 restart nginx and (php-fpm if being used)
service php-fpm restart
service nginx restart


--
If my answer is useful, please Accept as Solution & give Kudos