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