Jump to content

How can I solve memory limit problems?


Recommended Posts

after making the change as suggested by Mike Spike, check your phpinfo.

 

If you do not have a phpinfo then create a file called phpinfo.php

 

Place the following code into phpinfo.php

 

<?php phpinfo(); ?>

 

ftp up to your site

 

go to yoursiteurl/ phpinfo.php

 

now check the result by looking at your, should look like this memory_limit 128M 128M

i

Link to comment
Share on other sites

after making the change as suggested by Mike Spike, check your phpinfo.

 

If you do not have a phpinfo then create a file called phpinfo.php

 

Place the following code into phpinfo.php

 

<?php phpinfo(); ?>

 

ftp up to your site

 

go to yoursiteurl/ phpinfo.php

 

now check the result by looking at your, should look like this memory_limit 128M 128M

i

 

Where should I find it?

Into config folder, or in the root folder?

Link to comment
Share on other sites

Yes, most hosting providers set the default to 32M in order to conserve space and accommodate more customers, but at the same time they're usually very willing to upgrade an individual user's memory limit as long as they're not doing it for everyone. 64M is usually a good benchmark for PrestaShop where you should not ever have to worry about the memory_limit value.

 

-Mike

  • Like 1
Link to comment
Share on other sites

The answer was:

Edit .htaccess into httpdocs.

and modify memory limit to 128M

 

But I don´t have .htaccess in such directory

 

I added this line to the end of the .htacces file into my subfolder where the shop is:

php_value memory_limit 128M

 

Then I get Local Value 128M and Master Value 32M

?? :wacko:

Link to comment
Share on other sites

I keep the same. No success. I edited the .htaccess in both, www.mydomain.com (httpdocs folder) and in www.mydomain.com/shop folder.

When I go to www.mydomain.com/phpinfo.php or to www.mydomain.com/shop/phpinfo.php (in both I placed the phpinfo.php file) I get the same result: Local Value 128M and Master Value 32M, and I still don´t see the modules I want to see.

Is still the memory the problem and has the master value also to be set to 128M? Or is the module the problem? Others can use it.

And how to change the Master Value?

Maybe I have to go up to the root but I don´t have the permisions.

I will check again with my host provider...on monday.

Link to comment
Share on other sites

I got an answer from my hosting:

"the master value is the default for the server (php.ini) and the local value is the value for your hosting so that your hosting is already working with 128MB."

 

Then, I have to find another reason for why the modules I want to use are not working (Groupdiscount, Sales and Discounts)

:huh:

Link to comment
Share on other sites

I got an answer from my hosting:

"the master value is the default for the server (php.ini) and the local value is the value for your hosting so that your hosting is already working with 128MB."

 

Then, I have to find another reason for why the modules I want to use are not working (Groupdiscount, Sales and Discounts)

:huh:

 

Have you tried uninstalling some of the modules you never use to try to free up some extra memory?

 

-Mike

Link to comment
Share on other sites

Uninstalling modules is unlikely to help "Free more memory".

If you see the "Local Value" in php.ini that is lower than the "Server" value, i means you are using a php.ini file (likely in your root folder) which has the memory limit variable set to 32Mb, you should try to remove it and see if it helps.

 

You really need at least 64MB to run a site properly.

Link to comment
Share on other sites

I have just turned ON and:

In the Modules tab I get this message:

 

Warning: file_put_contents(/var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/groupdiscount/config.xml) [function.file-put-contents]: failed to open stream: Permission denied in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Module.php on line 1114

 

In Payment tab:

 

Warning: file_put_contents(/var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/groupdiscount/config.xml) [function.file-put-contents]: failed to open stream: Permission denied in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Module.php on line 1114

 

The messages seem the same. No other tabs give any message.

The first red (pink) message didn´t appear anymore, maybe memory increasing made this.

Link to comment
Share on other sites

Back again.

I checked the Groupdiscount module and it has 777 permisions.

I checked Modules folder and it has 777 permisions.

Anyway I applyed 777 permisions recursively to Modules folder.

In my Catalog tab it should appear Groupdiscount but still it doesn´t

I went to my Modules tab, and tryed to restart the Groupdiscount module: I get the message (I got it in spanish, but more or less) "The module can not be disabled". I do it again and the message now is: "The module has already been disabled"

Now is disabled. Now I want to enable again and I get this:

 

Warning: Missing argument 1 for TabCore::getTabs(), called in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/modules/groupdiscount/groupdiscount.php on line 55 and defined in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Tab.php on line 176

 

Notice: Undefined variable: id_lang in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Tab.php on line 178

 

Notice: Undefined variable: id_lang in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Tab.php on line 180

 

Notice: Undefined variable: id_lang in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Tab.php on line 184

 

Notice: Undefined variable: id_lang in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Tab.php on line 188

 

Notice: Undefined variable: id_lang in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Tab.php on line 189

 

Notice: Undefined variable: id_lang in /var/www/vhosts/aldeaglobaltarifa.com/httpdocs/tiendaweb/classes/Tab.php on line 190

 

And the last to notices are repeated at least 180 times (used Word to count)

and :

error2.pngThe following module(s) were not installed successfully:<p class="error">

  • groupdiscount

Link to comment
Share on other sites

Did you check the Owner / Group?

I don´t know what is that. In Prestashop? In my FTP? My Prestashop is in spanish.

 

Did you try to contact the developer of the module for help?

 

Now I think I will. Now is not a problem of memory limit or server. But many others seem to use that module without problem.

 

And many thanks for your attention and sorry for my english!!

Link to comment
Share on other sites

So then, how can I change it and how do I know how is it now?

Anyway, in my last image it is in spanish, but you can read:

 

Permisions UNIX 777

 

Propietario (Owner)

Grupo (Group)

Otros (Others)

Aplicar permisos de forma recurrente

(Apply permisions recursively)

 

And in all you can: read, write and execute.

Link to comment
Share on other sites

  • 1 year later...

Hi guys. I use prestashop 1.4.4.1 and time to time I have exactly the same problem as topicstarter. The modules I try to install are not installed, however presta reports "the module is already installed". What I have tried to do:

 

1) installing, deinstalling, deleting, uploding again - no success

2) loading by ftp and/or from backoffice - no success

3) playing with permissions (755, 777) - no success

4) checking memory limits - I have 128M both local value and master value - no success

5) uninstalling and/or deleting other modules - no success

 

This time I have this problem with 1-click autoupgrade module and with SEO updater module. Looks like it can happen with any module. This bug makes me crazy. I wanted to upgrade to 1.4.9.0 to get rid of the bug, but I cannot upgrade since the autoupgrade module cannot be installed!!! HELP!

 

p.s. trying to reproduce the issue on localhost (my home computer running windows/xampp) was not successful - everything works perfectly. But in windows there is no permission or memory problems ever possible...

Edited by dragster (see edit history)
Link to comment
Share on other sites

Hi guys. I use prestashop 1.4.4.1 and time to time I have exactly the same problem as topicstarter. The modules I try to install are not installed, however presta reports "the module is already installed". What I have tried to do:

 

1) installing, deinstalling, deleting, uploding again - no success

2) loading by ftp and/or from backoffice - no success

3) playing with permissions (755, 777) - no success

4) checking memory limits - I have 128M both local value and master value - no success

5) uninstalling and/or deleting other modules - no success

 

This time I have this problem with 1-click autoupgrade module and with SEO updater module. Looks like it can happen with any module. This bug makes me crazy. I wanted to upgrade to 1.4.9.0 to get rid of the bug, but I cannot upgrade since the autoupgrade module cannot be installed!!! HELP!

 

p.s. trying to reproduce the issue on localhost (my home computer running windows/xampp) was not successful - everything works perfectly. But in windows there is no permission or memory problems ever possible...

 

try this:

 

back office-->preferences-->performance

 

scroll down to caching (bottom)

 

set Use cache: 'No'.

 

now try installing module

  • Like 1
Link to comment
Share on other sites

try this:

back office-->preferences-->performance

scroll down to caching (bottom)

set Use cache: 'No'.

now try installing module

 

F*ck, it works!

But for God's sake, what does caching has to do with modules installation???

Prestashop drinks my blood, all of it.

  • Like 1
Link to comment
Share on other sites

  • 6 months later...

... what does caching has to do with modules installation???

A message from the Caching block:

 

Caching systems are used to speed up your store by caching data into the server's memory, avoiding the exhausting task of querying the database.

Link to comment
Share on other sites

Hi guys,

 

I have also a problem with memory limit. In my phpinfo I have memory limit 104M 104M (both Local Value and Master Value) but my site shows this error:

 

Fatal error: Out of memory (allocated 76021760) (tried to allocate 32 bytes) in /mnt/webn/e3/16/53561416/htdocs/Prestashop_01/classes/db/DbPDO.php on line 91

 

 

Should I ask for having 128M to my server? or 104M is fine?

 

Any suggestions?

 

Thanks very much

Link to comment
Share on other sites

Where exactly you have a memory problem?

 

I have seen a shop with almost 100k products and 2GB is the right amount of memory there and this amount is needed only for product indexation.

 

It is hard to say how much memory you need without details as PrestaShop version, number of products, memory eating modules, average traffic and so on.

Link to comment
Share on other sites

Hi Tuk66,

thanks for your answer. I think that if you read this post from the beginning you will understand what I mean. My site shows an error of memory limit and it is not working. I have created and phpinfo page and I have memory limit 104M. If you read before, people are saying about to have 64M or 128M.

 

I am using prestashop 1.5, for the momment I have 700 products. is that enough clear?

 

Thanks again.

Link to comment
Share on other sites

Hi Vekya,

thanks for your answer, do you know how can I change the memory limit from the .htaccess file?

 

I am trying to add the sentence "php_value memory_limit 128M" but it is doing an error.

 

thanks again.

Link to comment
Share on other sites

I just wanted to say that the error is in DbPDO.php file so it depends on amount of data fetched from the database. It means that depends on number of products or combinations or search index records etc.

 

I suggest to patch temporarily your script(s) with memory_get_peak_usage() function abd save results to a file to see how much memory your shop consumes over time. Then you can think about higher memory limit. I suggest to contact your server administrator as it is common that you can't change PHP memory limit value (even if phpinfo say something else, memory limit used stil can be different).

Link to comment
Share on other sites

I just wanted to say that the error is in DbPDO.php file so it depends on amount of data fetched from the database. It means that depends on number of products or combinations or search index records etc.

 

I suggest to patch temporarily your script(s) with memory_get_peak_usage() function abd save results to a file to see how much memory your shop consumes over time. Then you can think about higher memory limit. I suggest to contact your server administrator as it is common that you can't change PHP memory limit value (even if phpinfo say something else, memory limit used stil can be different).

 

where this file is located?

Link to comment
Share on other sites

memory_get_peak_usage() is PHP function, not PrestaShop one.

 

With "save results to a file" I have meant to create a quick logging feature with fwrite() function and save the memory peak value to a new file - maybe repeatedly and in a loop just to be sure that you will catch the peak before getting HTTP 500 Error or something similar.

Link to comment
Share on other sites

Hello vekia and tuk66,

 

thanks for your help. I just added:

 

echo memory_get_peak_usage();
echo  "<br>";

 

before the line of the error in the DbPDO.php file and the script was writting a lot, this is the end:

 

74197420

74197776

74198132

74198488

 

Fatal error: Out of memory (allocated 74711040) (tried to allocate 56 bytes) in /mnt/webn/e3/16/53561416/htdocs/Prestashop_01/classes/db/DbPDO.php on line 94

 

My memory limit is 104M, so this is > 74198488.

 

Please, what do you think?

Link to comment
Share on other sites

Very curious,

 

74198488

Fatal error: Out of memory (allocated 74711040) ......

 

the allocated 74711040 looks very similar with last memory_get_peak_usage() I had....it looks like this error

 

Fatal error: Out of memory (allocated 76021760) (tried to allocate 40 bytes) in /mnt/webn/e3/16/53561416/htdocs/Prestashop_01/classes/db/DbPDO.php on line 105

 

is saying what is the real memory-limit, Don't you think?

 

What can I do now?

 

I was talking with my server (strato) and they told me that I can change the memory limit from the config.inc.php,

 

I added this:

 

ini_set('memory_limit','128M');

 

but it doesn't do anything,

 

any more suggestion?

 

Thanks very much Tuk66 and Vekia for helping to me with this, ;-) ;)

Edited by Alraul (see edit history)
Link to comment
Share on other sites

Once again. Ask your server administrator to memory restrictions directly in the webserver and other systems. I used a similar approach to find out that PHP's timeout is only one limitation and scripts failed due to another, not be influenced, timeout limit in other systems.

Link to comment
Share on other sites

I added this:

 

ini_set('memory_limit','128M');

 

 

but it doesn't do anything,

 

it's because hosters usually block this feature, Imagine what would happen if everyone on shared host had access to this. Prudent allocation of resources is the most important thing about the stability of the servers, especially shared

Link to comment
Share on other sites

The server (Strato) doens't do that, I spoke again and they told me that if I can't do this change by myself it is because the hosting server has this configuration and they don't go to change it.

 

Their answer was, if you don't like the product you can leave it.!! (refering to the hosting), :-(

 

SO, do you think can I resolve the problem with that memory_limit or I Will need to change the hosting?

 

Thanks for the suppor!

Link to comment
Share on other sites

×
×
  • Create New...