Jump to content
Remitur

Allowed memory size of 33554432 bytes exhausted

Recommended Posts

In my WHMCS dev environment, all at once crons stopped working regularly.

Looking for errors, I found several "Allowed memory size of 33554432 bytes exhausted":

[25-Jun-2020 00:01:01 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 139264 bytes) in /home/devdomai/public_html/whmcs/vendor/composer/ClassLoader.php on line 444
[26-Jun-2020 13:41:10 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 2359296 bytes) in /home/devdomai/public_html/whmcs/vendor/guzzlehttp/guzzle/src/Event/Emitter.php on line 62
[26-Jun-2020 13:41:10 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 2359296 bytes) in /home/devdomai/public_html/whmcs/vendor/guzzlehttp/guzzle/src/Event/Emitter.php on line 62
[26-Jun-2020 16:01:42 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 2359296 bytes) in /home/devdomai/public_html/whmcs/vendor/guzzlehttp/guzzle/src/Message/Request.php on line 12
[26-Jun-2020 16:01:42 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 2359296 bytes) in /home/devdomai/public_html/whmcs/vendor/guzzlehttp/guzzle/src/Message/Request.php on line 12
[27-Jun-2020 12:00:56 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 2359296 bytes) in /home/devdomai/public_html/whmcs/vendor/guzzlehttp/guzzle/src/Message/Request.php on line 12
[27-Jun-2020 12:40:28 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 2359296 bytes) in /home/devdomai/public_html/whmcs/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php on line 163

It could be a good explanation of the cause of the error, but... the issue is that, according to phpinfo, the allowed memory size is not 32MB, but 128 MB.

particularly: 

According to WHMCS "internal" phpinfo, the value is:

memory_limit          128M                 32M

(the first one being the "local value", and the second one the "master value")

And the same according both to a plain phpinfo in root, and also in /whmcs/vendor/guzzlehttp/guzzle/src/

So, the question is: why and how these scripts adopt the "master value" of memory_limit, instead of the "local value" ?!?!

 

Share this post


Link to post
Share on other sites
1 hour ago, Remitur said:

According to WHMCS "internal" phpinfo

Look in that file for any additional config files? Near the top: "Configuration". There may be a stray ini or .htaccess affecting it?

Share this post


Link to post
Share on other sites
51 minutes ago, bear said:

Look in that file for any additional config files? Near the top: "Configuration". There may be a stray ini or .htaccess affecting it?

I looked for .htaccess hidden somewhere... and I put also a phpinfo in the /whmcs/vendor/guzzlehttp/guzzle/src/ directory... and it answers the right local value too.

So I can't explain why that script is using "master" value instead of local... 😕

Share this post


Link to post
Share on other sites

There was nothing mentioned in the WHMCS phpinfo page (at the top) about "Configuration" files anywhere?

Share this post


Link to post
Share on other sites
Posted (edited)

Hi @Remitur,

On 6/27/2020 at 2:24 PM, Remitur said:

So, the question is: why and how these scripts adopt the "master value" of memory_limit, instead of the "local value" ?!?!

Are you using MultiPHP INI and where is your crons folder relative to your WHMCS install?

If your crons folder is in your "home" directory it will use the local PHP INI and values for there. If none are set it will inherit the system values.

So even if you change the values in your WHMCS install directory (I guess within public_html) it will report your changes accurately for that "folder" but not the values that are being applied when your cron jobs run in their particular location.

 

 

Edited by Vox
typo

Share this post


Link to post
Share on other sites
On 6/28/2020 at 5:32 PM, Vox said:

If your crons folder is in your "home" directory it will use the local PHP INI and values for there. If none are set it will inherit the system values.

So even if you change the values in your WHMCS install directory (I guess within public_html) it will report your changes accurately for that "folder" but not the values that are being applied when your cron jobs run in their particular location.

You got it!!!

Thank you!

(I've  always found annoying that "move the directory elsewhere for security reason"... I guess that protecting it using .htaccess would be as safe as moving it, but more error-proof...) 

Share this post


Link to post
Share on other sites

Hi @Remitur,

No problem. That had me scratching my head for quite a while a couple of months ago.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated