Jump to content

Prestashop and PHP memory_limit


Recommended Posts

Hello,
 
I'm having an issue getting Prestashop to recognize the php memory_limit. 

My environment:
LAMP Stack (Virtual Machine)
SMP Debian 3.2.51-1
Apache 2.2.22
PHP 5.4.4
Prestashop 1.5.6.2
 
In my php.ini I have specified a memory limit of 1024M however when I look at Prestashop Advanced parameters configuration information it only shows 256M. A separate script outside of Prestashop using phpinfo() shows 1024M. I've also added ini_set('memory_limit','1024M'); to config.inc.php.
 
 
Thanks,
Dan
Link to comment
Share on other sites

I am using the main php.ini for reference it's located here:

 

/etc/php5/apache2/php.ini

 

phpinfo() in a test php script with in the prestashop root directory show's the memory_limit as it is in php.ini yet Prestashop is reporting differently and I have a module that fails due to memory limit being exceeded, the error indicates the memory_limit as 256M.

 

This is the error:

 

Allowed memory size of 268435456 bytes exhausted (tried to allocate 97 bytes)

Link to comment
Share on other sites

I have 1 php.ini file in use. My concern is everything but prestashop shows that i'm using 1024M. Test scripts with phpinfo() indicated the correct path to the ini and also show the memory_limit as 1024M. I'm confident the VM is setup correctly and I only have 1 php.ini file. 

 

Link to comment
Share on other sites

I am using the main php.ini for reference it's located here:

 

/etc/php5/apache2/php.ini

 

phpinfo() in a test php script with in the prestashop root directory show's the memory_limit as it is in php.ini yet Prestashop is reporting differently and I have a module that fails due to memory limit being exceeded, the error indicates the memory_limit as 256M.

 

This is the error:

 

Allowed memory size of 268435456 bytes exhausted (tried to allocate 97 bytes)

 

Typically error from an infinite loop. You've got an error code.

 

Regards

Link to comment
Share on other sites

At this point I would contact your hosting provider to give you the specifics regarding your php limits, the php.ini file and your vm setup. If the host is not communicating the memory limits with your PrestaShop files, there may be some configuration issue. 

 

 

 

Hello,
 
I'm having an issue getting Prestashop to recognize the php memory_limit. 

My environment:
LAMP Stack (Virtual Machine)
SMP Debian 3.2.51-1
Apache 2.2.22
PHP 5.4.4
Prestashop 1.5.6.2
 
In my php.ini I have specified a memory limit of 1024M however when I look at Prestashop Advanced parameters configuration information it only shows 256M. A separate script outside of Prestashop using phpinfo() shows 1024M. I've also added ini_set('memory_limit','1024M'); to config.inc.php.
 
 
Thanks,
Dan

 

 

Regarding the ini_set in the config.php, you should add/edit the memory limit in the php.ini file on your server. Your hosting provider can provide you details on how to edit it, or they can edit it themselves. It just doesn't look like the changes of php are reflected on your store. If it helps, there is a blog post on my signature regarding the php.ini file and how you can optimize it, but be aware that it may be different with your own vm and host. 

Link to comment
Share on other sites

  • 1 year later...

About different memory limit ,setted at php.ini and  different value displayed  at  Prestashop configuration information problem.

I had the same problem, 1024 M at php.ini , 256M displayed at configuration information

The problem came from a custom module (prestaspeed in my case)  witch have it is own ini_set settings ....

Editing the file , and setting the Memory limit at 1024 , and now the configuration information display the correct memory 

 

If you have shell root access the command 

grep -r "ini_set('memory_limit*" /PATH_TO_YOUR_SITE  , will show all the instances of memory limit

 

The path in my case at centos 7 server is

grep -r "ini_set('memory_limit*" /var/www/clients/client0/web2

 

Hope it helps :)

Link to comment
Share on other sites

  • 1 month later...

My site is http://www.backtomycharity.com/ in prestashop front end of site is working well but backened of site is very slow when we manualy decrease memory_limit=64m  then error message show :

 

All modules cannot be loaded due to memory limit restrictions, please increase your memory_limit value on your server configuration.

 

My server information is below:

Server information Linux #1 SMP Tue Dec 16 20:36:56 MSK 2014 x86_64

Server software version Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4

 

PHP version 5.4.33

Memory limit 2G

Max execution time 0

 

please help as soon as possible.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...