CMSMS 2.2.9 doesn't accept PHP memory_limit

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
MHCWebDesign
New Member
New Member
Posts: 2
Joined: Fri Feb 22, 2019 5:40 pm

CMSMS 2.2.9 doesn't accept PHP memory_limit

Post 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?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
MHCWebDesign
New Member
New Member
Posts: 2
Joined: Fri Feb 22, 2019 5:40 pm

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Post 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?
pwg
Forum Members
Forum Members
Posts: 191
Joined: Tue Aug 01, 2006 1:48 am
Location: Sydney

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Post 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
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Post 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).
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CMSMS 2.2.9 doesn't accept PHP memory_limit

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “CMSMS Core”