Jump to content

Main module file > 420 kb AND in php.ini memory_limit = 128M ; BackOffice = 500 Internal Server Error


SPM modules

Recommended Posts

Hi

For example:

1. Prestashop 1.7.x.x

2. by default in the php.ini memory_limit = 128M

3. Main module file (/modules/mymodule/mymodule.php)  mymodule.php > 420kb . For test try using 500kb!

4. go to backoffice -> Improve -> Modules -> Modules & Services and you get:

- 500 Internal Server Error 

OR

- Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8960 bytes)

 

This error related ONLY if main module file more than 420kb. (Better for example try using main file more than 500kb). This error related with Parser of the Prestashop 1.7.x.x!

Please check it!

 

IMPORTANT: only for Prestashop 1.7.x.x and memory_limit = 128M

 

Best Regards

Link to comment
Share on other sites

53 minutes ago, bellini13 said:

This has nothing to do with the size of the file.  This is how much memory is available to your PHP process, which is 128mb

The error is telling you that you ran out of memory, as the process needed 134mb and can only use 128mb

 

I known, that ran out of memory.

Maybe prestashop team will make tests, because if I develop big module - my module is not approved prestashop team!

 

Link to comment
Share on other sites

On 16.11.2017 at 3:42 PM, SPM modules said:

 

I known, that ran out of memory.

Maybe prestashop team will make tests, because if I develop big module - my module is not approved prestashop team!

 

You are forgetttin a major point: 128 mb is the lowest limit users are also using on their servers. If your module explode this, it will not run too. So it's better you be conform to Prestashop requirements and minimize the code.

Link to comment
Share on other sites

On 11/18/2017 at 5:19 AM, bellini13 said:

size of the php file is likely not the factor here.  I can easily write a php script with a few lines of code that will make your server run out of memory. 

I just say about a problem that exists. Yes, I also can write php code: endless cycle, but problem not in this

Link to comment
Share on other sites

I didn't say your problem was caused by an endless cycle, I was simply explaining that the performance of a php script (no matter how small or large) can cause out of memory issues.

We have no idea what you did in your module, but whatever it is obviously requires more memory.  Start for you to start analyzing the code and determine if you can remove some of the memory utilization.

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