Page 1 of 1

CMSMS 2.2.9 doesn't accept PHP memory_limit

Posted: Fri Feb 22, 2019 5:50 pm
by MHCWebDesign
I am unable to cause CMSMS to accept the PHP memory_limit setting.
I have configured the memory_limit in a 'php.ini' file, as follows:

Code: Select all

memory_limit = 1024M;
And I verified it via a phpinfo() script, the server accepts this value!

However, the CMSMS itself always gets stuck at a 64M limit, with the following error message:

Fatal error: Out of memory (allocated 65011712) (tried to allocate 262144 bytes) in /home/woodstoc/public_html/lib/classes/Database/class.compatibility.php on line 94

I also tried this in the 'config.php':

Code: Select all

$config['php_memory_limit'] = '1024M';
Makes no difference!

Is there a way to force CMSMS to accept a higher memory_limit, greater than 64M? Or is this a bug in CMSMS?

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Posted: Fri Feb 22, 2019 6:43 pm
by calguy1000
CMSMS certainly does listen to PHP's memory limit.

Depending on your environment you are either not editing the correct php.ini file, or not setting it properly.

php.ini files in the CMSMS root directory may be for requests made to php files in that directory only. So it may have no effect on the admin directory.

Simple test:

put a file with:

Code: Select all

<?php phpinfo();
into both the CMSMS root, and the admin directory.... open up both in your browser, and compare the memory limits.

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Posted: Fri Feb 22, 2019 7:27 pm
by MHCWebDesign
Thank you for your reply.

I tested it with a phpinfo(); call for the 'admin', and even the 'lib/classes/Database' folder, same result:

Code: Select all

memory_limit	1024M	32M
I always thought that sub-folders don't inherit the php.ini settings? Perhaps it inherited it from a root folder's '.user.ini' file which has the same setting:

Code: Select all

memory_limit = 1024M;
At any case, the CMSMS simply won't accept the higher 'memory_limit' setting! Is there anywhere else where it can be configured for CMSMS?

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Posted: Mon Mar 11, 2019 3:07 am
by pwg
Hi, not sure if this issue was solved for MHCWebDesign or not, however we had a similar issue, and also found that CMSMS 2.2.9 wouldn't hold master memory_limit if we were using PHP Version 7.2.15.

I found this when trying (unsuccessfully) to upgrade sites to CMSMS 2.2.10.

However CMSMS 2.2.9 does hold a set memory_limit on PHP Version 7.1.26.

Our workaround was to downgrade all sites to
PHP Version 7.1.26, then upgrade to CMSMS 2.2.10 - which does hold the set memory_limit, and then upgrade PHP 7.2.15.
Maybe this will help someone.
Cheers
Paul

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Posted: Mon Mar 11, 2019 1:29 pm
by velden
You could even check in a UDT by entering this code:

Code: Select all

phpinfo();
Save the UDT, open it again and press the 'Run' button.

Also you can check the Site Admin > System Information page (though I noticed on my test-install 2.2.9.1 that the value there is empty).

Theoretically there could also be a 3rd party module, UDT or plugin causing this behavior (if it explicitly sets the memory limit).

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Posted: Mon Mar 11, 2019 3:18 pm
by calguy1000
Again.
CMSMS certainly does listen to PHP's memory limit.
And NOTHING has changed wrt php memory limit stuff in CMSMS version 2.2.x.
ANY of the releases.

So your problems with memory limits are almost certainly related to your not being familiar with how to set the memory limits well on your environment. And. if you are changing php versions in your environment, then the files you may have to edit may change depending on how your host builds PHP.

Again. phpinfo() will tell you what files your environment reads to allow you to change php.ini settings (including memory limit). And, depending on what file(s) you edit you may have to test the memory limit in different directories.