latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

WP MAx memory limit

Home Forums Community Forum WP MAx memory limit

Tagged: 

This topic contains 7 replies, has 4 voices. Last updated by  Jason (Lead Developer) 3 years, 4 months ago.

Topic Author Topic
Posted: Saturday Aug 17th, 2013 at 6:21 am #56071
o2xav
Username: o2Xav

Hi,

I’m also having a problem updating S2member, the script returns:

Not enough memory. Unzipping s2Member Pro via WordPress® requires 256M of RAM. Please upgrade via FTP instead.

php.ini is set to use a max of 512M:
phpinfo () returns :

memory_limit	512M	

here is a sample of wp-config.php:

define('WP_MAX_MEMORY_LIMIT', '256M' /* WebSharks™ Core auto-fix. */);
define('WP_MEMORY_LIMIT', '256M');

It’s the second time it occurs, please find a fix as i am not the only one, and updating via FTP every week or so… you see what i mean.

Your server scanning tool does not detect any problem regarding memory

Thank you

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Saturday Aug 17th, 2013 at 8:59 am #56073
Randy King
Username: RandyKing

It’s clear that there’s something awry with the pro upgrade process, and it’s not necessarily s2Member. I just wonder if there’s a memory hog out there. I’m going to try disabling all plugins and then upgrading. I will report back.

======

OK, I disabled every plugin except for s2Member Framework, and switched to the generic vanilla WP 2013 theme and I am still getting the memory error.

See also: http://www.s2member.com/forums/topic/how-to-fix-not-enough-memory-for-upgrades/

Posted: Tuesday Aug 20th, 2013 at 12:36 am #56212
Bruce
Username: Bruce
Staff Member

Thanks for the info. I’m going to go ahead and close the other thread that you made, Randy and contact Jason to see if there’s something he can shed some light on with this.

I am going to test this myself quickly. I’ll update this thread when I have results.

Posted: Tuesday Aug 20th, 2013 at 1:53 am #56217
Bruce
Username: Bruce
Staff Member

Thanks for your patience.

Sorry, I’m not able to reproduce this on any of my test installations. I’ll see what Jason has to say about this.

Posted: Tuesday Aug 20th, 2013 at 4:31 am #56231
Staff Member

Thanks for reporting this important issue.

php.ini is set to use a max of 512M:
phpinfo () returns :

<div class="s2-code-tools"><a href="#" class="s2-code-select-all" onclick="s2_selectAll(jQuery(this).parent().next()); return false;" title="Select All"></a><a href="#" class="s2-code-view-source" onclick="s2_viewSource(jQuery(this).parent().next()); return false;" title="View Source"></a></div><code>memory_limit	512M	</code>

here is a sample of wp-config.php:

<div class="s2-code-tools"><a href="#" class="s2-code-select-all" onclick="s2_selectAll(jQuery(this).parent().next()); return false;" title="Select All"></a><a href="#" class="s2-code-view-source" onclick="s2_viewSource(jQuery(this).parent().next()); return false;" title="View Source"></a></div><code>define('WP_MAX_MEMORY_LIMIT', '256M' /* WebSharks™ Core auto-fix. */);
define('WP_MEMORY_LIMIT', '256M');</code>

First, I should point out WHY s2Member needs this much RAM, in this specific case. It’s actually not s2Member which needs the RAM, it’s the core WordPress® unzip routine that s2Member uses. In order to unzip a file it requires quite a bit of RAM to hold the data while it’s processing.

Here is the line that comes straight from s2Member’s pro upgrade routine which checks for memory available.

if(@set_time_limit(0) !== "nill" && @ini_set("memory_limit", apply_filters("admin_memory_limit", WP_MAX_MEMORY_LIMIT)) !== "nill" && @ini_get("memory_limit") === apply_filters("admin_memory_limit", WP_MAX_MEMORY_LIMIT))

In short, having this configured the right way (e.g. to provide enough memory in your configuration); is only the first part of resolving this. The second part requires that you verify that your server is actually following your configuration. If you are setting WP_MAX_MEMORY_LIMIT correctly, but still getting this error, my guess is that your server is not really allowing this, even though you’ve configured it as such.

Here’s how to test it on your server.

Create a new PHP file, just name it ram-test.php and upload it to your root web directory (in the same directory where your wp-config.php file resides). Inside this file, make an attempt to set the memory limit to what you’ve configured WP_MAX_MEMORY_LIMIT with and see what happens.

Here is how I would test it if I were investigating your server.

<?php
require dirname(__FILE__).'/wp-load.php';

if(@set_time_limit(0) !== 'nill'
	&& @ini_set('memory_limit', apply_filters('admin_memory_limit', WP_MAX_MEMORY_LIMIT)) !== 'nill'
	&& @ini_get('memory_limit') === apply_filters('admin_memory_limit', WP_MAX_MEMORY_LIMIT))
		echo 'Memory looks good! Server reports: '.@ini_get('memory_limit').' which DOES match up with what s2Member expects: '.apply_filters('admin_memory_limit', WP_MAX_MEMORY_LIMIT);
else echo 'Memory has issues. Server reports: '.@ini_get('memory_limit').' which does NOT match up with what s2Member expects: '.apply_filters('admin_memory_limit', WP_MAX_MEMORY_LIMIT);
?>

Run this file and please report back and let us know what message you got. If we get some feedback on this test, we can certainly try to improve things further, if possible.

If you need help with this, please submit a Dashboard login privately.
See: s2Member® » Private Contact Form

Posted: Tuesday Aug 20th, 2013 at 6:12 am #56240
o2xav
Username: o2Xav

Hi,

Thanks for answering, here is the output :

Memory has issues. Server reports: 512M which does NOT match up with what s2Member expects: 256M
Posted: Tuesday Aug 20th, 2013 at 7:56 am #56250
Randy King
Username: RandyKing

Bruce, Jason – Thanks. I know, it’s frustrating. I have other sites where this is functioning perfectly. One of them even has 2 pages of active plugins! And they’re on the same server. Crap, hate it when this kind of stuff happens.

Thanks for the test code, will drill down and see what the real story is there, and report back for the benefit of the community.

Posted: Tuesday Aug 20th, 2013 at 8:29 am #56253
Staff Member
@o2Xav

Memory has issues. Server reports: 512M which does NOT match up with what s2Member expects: 256M

Ah, so what’s happening here is that your core PHP configuration is set higher than what WordPress® knows about; and this is tripping up the s2Member® upgrade routine. That’s something we can definitely fix. We’ll have this updated and a fix applied to the next release.

However, please NOTE. You’ll have to go through two upgrades before this actually will correct the problem for you. An upgrade from your current version to the next, will use the upgrader from the previous version :-) So it’s not until your next update that you’ll get the new upgrader. Make sense?

If you don’t want to wait, you can install this patch file. Upload this file and allow it to override your existing copy of: /s2member-pro/includes/classes/upgrader.inc.php. Even still, upgrading with this new file now (before it’s actually in the official copy of the software); will ultimately downgrade the upgrader. lol

Better to wait for this to come in the next maintenance release IMO.

DEV COPY: http://d1v41qemfjie0l.cloudfront.net/s2member/uploads/bbpress/2013/08/upgrader.inc.php

Viewing 7 replies - 1 through 7 (of 7 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.