Remitur Posted June 27, 2020 Share Posted June 27, 2020 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" ?!?! 0 Quote Link to comment Share on other sites More sharing options...
bear Posted June 27, 2020 Share Posted June 27, 2020 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? 0 Quote Link to comment Share on other sites More sharing options...
Remitur Posted June 27, 2020 Author Share Posted June 27, 2020 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... 😕 0 Quote Link to comment Share on other sites More sharing options...
bear Posted June 27, 2020 Share Posted June 27, 2020 There was nothing mentioned in the WHMCS phpinfo page (at the top) about "Configuration" files anywhere? 0 Quote Link to comment Share on other sites More sharing options...
Vox Posted June 28, 2020 Share Posted June 28, 2020 (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 June 28, 2020 by Vox typo 1 Quote Link to comment Share on other sites More sharing options...
Remitur Posted June 30, 2020 Author Share Posted June 30, 2020 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...) 0 Quote Link to comment Share on other sites More sharing options...
Vox Posted June 30, 2020 Share Posted June 30, 2020 Hi @Remitur, No problem. That had me scratching my head for quite a while a couple of months ago. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.