Jump to content

Module page not loading - increase your memory_limit value on your server configuration


Recommended Posts

Some modules are loading and I get this message:

 

 

The following module(s) could not be loaded:

  • All modules cannot be loaded due to memory limit restriction reason, please increase your memory_limit value on your server configuration

What is the recomended memory limit for prestashop on a server? I have now 20Mb for php.
Is there is a workaround for this? or do I have to contact my hosting provider to increase the php memory on my server?
Thanks,
Bernie
Link to comment
Share on other sites

  • 4 weeks later...

I had a memory_limit problem while trying to configure the PrestaShop Security module. First, I installed the php.ini master file by going to PHP config under my cpanel provided by my host. I changed the line for the memory_limit to "memory_limit = 128 ; Maximum amount of memory a script may consume (128MB)", but this did not fix my problem. I then added "ini_set('memory_limit','128M);" to my config/config.inc.php file as suggested by bellini13 and this solved the problem. Thank you! :)

  • Like 1
Link to comment
Share on other sites

A related but slightly different question, if someone could help me please?

 

I was looking at the PHP info report and noticed this specific item.

 

Current PHP variables…

 

memory_limit

Local Value 134217728

Master Value 64M

 

Since I've installed the PrestaShop on the same dedicated server as our vBulletin forums, I've been experiencing some anomalies and strange site outages. We've always run a caching program called vB Optimise for use with vBulletin (uses Memcache) without any problem and for some reason, since installing the shop, something is preventing the AJAX calls that vB Optimise performs for its self check, causing it to fail.

 

So, I'm not a programmer, but I'm trying to track down what could possibly be the problem. The local master value for PHP memory used to be exactly the same as the local value, but now I notice that it's different, indicating that something new is causing the value to be increased to 128MB allocated for PHP Memory, over riding the master value of 64MB.

 

Is it possible that some module in PrestaShop or it's add-ons is doing this and where can I check to validate if this increase value is coming from the programming of this new sshop environment.

 

Thanks for any feedback .. :)

 

Regards,

Doug

Link to comment
Share on other sites

  • 2 weeks later...

Hello..im completely new to this..im trying to change my theme on my prestashop. I download a template & exported the contents to my prestashop root directory as instructed. When i log in to my admin, and go area where i can use the themeinstaller module...i get this message

The following module(s) could not be loaded:

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

I have read the comments, but not sure as to where to find the file to increase the limit..am i just better of telling my hosing company to do it?? many thanks in advance

Link to comment
Share on other sites

  • 1 month later...

Hello guys,

 

I'm having the same issue with a brand new 1.4.7 installation. This is the message which I'm getting when I try to get a listing of all the modules so that I can start enabling disabling modules.

 

Error Message is:

 

The following module(s) could not be loaded:

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

 

These are the fixes which I've tried and nothing has changed.

 

1. Changes in Tools.php

 

public static function getMemoryLimit()

{

//$memory_limit = @ini_get('memory_limit');

$memory_limit = "2048M";

 

/*if (preg_match('/[0-9]+k/i', $memory_limit))

return 1024 * (int)$memory_limit;

 

if (preg_match('/[0-9]+m/i', $memory_limit))

return 1024 * 1024 * (int)$memory_limit;

 

if (preg_match('/[0-9]+g/i', $memory_limit))

return 1024 * 1024 * 1024 * (int)$memory_limit;*/

 

 

return $memory_limit;

}

 

2. Changes in config.inc.php

 

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

 

3. Got the host to change the memory to the max which they can allow for a while to test this issue out.

 

memory.jpg

 

4. Tried to over-ride php.ini and set my own values which were reflecting in phpinfo().

 

and still no cure for this.

 

Please help me on this and let me know if there's any other possible solution to this.

 

Regards,

 

Anirban.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Hi prmag,

 

You should ask your host provider to increase the memory_limit to 128Mo.

 

salut carl. quick questions. is 128 mandatory? I mean on your page with system requirements it says

 

memory_limit à"64M" et file_max_upload_size à "16M"

 

so which one is correct now? also, the 64M is stated as being 'optional'. I am asking because I want to upgrade my 1.3.x to 1.4.x and do not know whether it will work. my hosting provider offers currently 60M.

 

phil

Link to comment
Share on other sites

I have seen that most v1.4 installs required 128MB, but only if you need to review the modules page in the back office, or the translation pages. This is because there is just so much information that needs to be held within memory.

 

if you do not use the translation pages, or you delete unused modules from the filesystem, then you can likely get by with 60MB

Link to comment
Share on other sites

if you have many modules enabled

 

alright, how much is 'many' then? and is deactivating modules enough or do I really need to uninstall/delete them physically?

 

I ask because I surely will need the modules page for changing some things every once in a while (if only google sitemap or homepage slides). right now I have maybe 44 modules installed and active (many of them just free blocks) + all the statistics modules. would that be too much for 1.4.x? I could ged rid of the majority of the statistics modules as the only one I use is the 'users online', any other statistics I get from google analytics anyway.

 

any advice is appreciated

phil

Link to comment
Share on other sites

With your current configuration you are most likely to have a blank page on the modules page.

 

Uninstall the modules you do not use. The best is to duplicate your shop so you can upgrade, check the modules page and plan what to do for the real upgrade.

Link to comment
Share on other sites

With your current configuration you are most likely to have a blank page on the modules page.

 

Uninstall the modules you do not use. The best is to duplicate your shop so you can upgrade, check the modules page and plan what to do for the real upgrade.

thx

Link to comment
Share on other sites

Hi all

 

I have just installed Prestashop (hoping to change from oscommerce). But the modules and payment tabs are not fully loading (see attachment).

 

I have increased the memory limit to 128M in php.ini and config/config.inc.php - but it hasn't solved the problem.

 

Any help would be appreciated!

 

Thanks.

post-357597-0-35332200-1335454758_thumb.jpg

Link to comment
Share on other sites

After some further investigation, it seems that if I remove all the modules then the page will load. But as soon as I install a module (even just 1!) then it fails to load.

 

Can anyone help?

 

Thanks.

Link to comment
Share on other sites

Hi mrdibb,

 

Enable the debug mode to see what kind of error message you get on these pages.

To do it, edit config.inc.php in \config folder and change

 

/* Debug only */

@ini_set('display_errors', 'off');

define('_PS_DEBUG_SQL_', false);

 

to

/* Debug only */

@ini_set('display_errors', 'on');

define('_PS_DEBUG_SQL_', false);

  • Like 1
Link to comment
Share on other sites

Thanks Carl

 

I now have the error message:

 

Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /[dir]/classes/Tools.php on line 2273

 

Fatal error: Call to undefined function libxml_use_internal_errors() in /[dir]/classes/Module.php on line 541

Link to comment
Share on other sites

  • 4 weeks later...

Hi mrdibb,

 

Could you give me in PM your back office + FTP credentials so a developer can take a look?

 

Thanks.

 

 

I have same problem like MRDIBB but me message is Fatal error

: Cannot redeclare class helperfn in

/modules/shipwire/HelperFn.php

on line

3

 

What i can do now ?? How to fix it ??

Link to comment
Share on other sites

  • 2 months later...

You can try to add the following line to the config/config.inc.php file. If this does not work, then you may need to get your host provider to do this for you

 

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

 

It works! great!. thank you genius. Thumbs up. :)

Link to comment
Share on other sites

  • 1 year later...
  • 7 months later...

You can try to add the following line to the config/config.inc.php file. If this does not work, then you may need to get your host provider to do this for you

 

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

Thanks Bellini.I found your post.After i change server i had this problem.Even php.ini file was right.After i add this line it is working great.

Thanks,Thanks,Thanks

Link to comment
Share on other sites

  • 1 year later...

You can try to add the following line to the config/config.inc.php file. If this does not work, then you may need to get your host provider to do this for you

 

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

 

I added the "ini_set" line and my site disappeared. When I restored the original config/config.inc.php file the site is still unreachable. I get nothing but a blank screen. Can you or anyone else help me resolve this issue?

 

This is the error I receive after adding:

 

@ini_set('display_errors', 'on');

define('_PS_DEBUG_SQL_', true);

 

to the config.inc.php file

 

Fatal error: Uncaught exception 'Adapter_Exception' with message 'Service container is not set.' in /home/omnomnut/public_html/omnom/Adapter/Adapter_ServiceLocator.php:49 Stack trace: #0 /home/omnomnut/public_html/omnom/classes/ObjectModel.php(232): Adapter_ServiceLocator::get('Adapter_EntityM...') #1 /home/omnomnut/public_html/omnom/classes/shop/Shop.php(131): ObjectModelCore->__construct('1', NULL, NULL) #2 /home/omnomnut/public_html/omnom/classes/shop/Shop.php(397): ShopCore->__construct('1') #3 /home/omnomnut/public_html/omnom/config/config.inc.php(100): ShopCore::initialize() #4 /home/omnomnut/public_html/omnom/admin8080/index.php(36): require('/home/omnomnut/...') #5 {main} thrown in /home/omnomnut/public_html/omnom/Adapter/Adapter_ServiceLocator.php on line 49

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

  • 1 month later...

Hi, I am using prestashop 1.5.6 english version, I have deleted 4 files from my httpdocs folded "product.php, productdownload.php, productsale.php, product supplier.php and configuration.php"


After deleting these file my site was not working then i paste these file again on same location. 


But after that my site is working too slow. taking 10+ sec to load. 


please help me to solve the issue. please check my site http://slmobileprice.com


 


Thanks,


Somit


Link to comment
Share on other sites

  • 7 months later...

You can try to add the following line to the config/config.inc.php file. If this does not work, then you may need to get your host provider to do this for you

 

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

 

The memory allocation error can be SOLVED by doing what's suggested by bellini13. Just wanted to add further clarification based on my understanding (I'm new! Spare me) after having solved the problem as well.

 

I believe this applies for all errors similar to the following (and is what I'll only cover here):-

"Fatal error: allowed memory size of 33554432 bytes exhausted (tried to allocate 3872 bytes)" 

Taking from example error above "33554432 bytes" may well be the default memory_limit set by your host provider (as it is with mine) i.e. 32MB (which = 33554432 bytes. The limit may be different for others I'm not sure.)

 

Three workarounds suggested (briefly):-

  1. Add a line "memory_limit = **M" to the ini.php file.
  2. Add a line "ini_set('memory_limit','**M');" to the config.inc.php file.
  3. Update your server php memory limit to **M
  • ​** 64(MB), 128(MB) or higher depending on how much memory exhausted stated in the error.

    e.g. 64MB works for me since 32MB were exhausted and I needed something higher than 32MB but total required memory less than 64MB.

I initially tried the first option, changing the memory limit to 64MB but the error still comes up, saying allowed memory size is 32MB (remains unchanged even with the edit).

 

The second option works for me. As mentioned, the file "config.inc.php" can be found at *your_prestashop_directory*/config/

 

Here's where I created a new line for the memory limit edit "ini_set('memory_limit','64M');" inside the config.inc.php

/* Improve PHP configuration to prevent issues */
ini_set('default_charset', 'utf-8');
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
ini_set('memory_limit','64M');

I don't know if it'll make any difference if it's placed anywhere else (enlighten me, happy to know), but it works.

After confirmation, I deleted the added memory_limit line in the "ini.php" and everything still works fine.

 

I almost went for the third option, which seems reasonable after knowing that the server's php memory limit are set as default and I think it'll work the same. (I didn't go for it cause I didn't want to affect other websites under the server, or rather, I don't know if it will).

 

Hope this helps.

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

  • 6 months later...

Hello Everyone!

 

I added the following line 

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

 

To the config/config.inc.php file.

In fact, my hosting provider did it for me and I GET A 500 CODE ERROR

 

I can change the translation of everything: front office, emails, etc. BUT NOT the translation of modules installed  and I need to change the translation of the modules installed. PLEASE HELP I keep getting the waring message to change the PHP settings only when I want to change the translation of modules installed.

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...