memory limit not recognized

snapshot reports:

Memory Limit 40M - WP_MEMORY_LIMIT defined by WordPress wp-config.php.

BUT there is nothing in my wp-config.php regarding memory and phpinfo() says:

memory_limit 256M

so what is wrong here?

oh and btw. there is another warning shown by this plugin:

WP_CRON - Disabled. Check your wp-config.php for the DISABLE_WP_CRON define. Either remove it or set the value to "false"

I have purposefully disabled wp_cron for another plugin which I have switched from wp_cron to real system cron, is there any chance to get a sample cron entry so I can use system cron instead of wp_cron?

  • Paul

    @Ovidiu,

    BUT there is nothing in my wp-config.php regarding memory and...

    That 40Mb memory setting then is being set internal to WordPress. This is somewhat a default setting when WordPress first loads itself. The basic process is IF you don't have the WP_MEMORY_LIMIT set in your wp-config.php then when WordPress loads itself it will set a default memory limit

    To see this look in your WordPress core code /wp-includes/default-constants.php lines 18-25

    // set memory limits
    	if ( !defined('WP_MEMORY_LIMIT') ) {
    		if( is_multisite() ) {
    			define('WP_MEMORY_LIMIT', '64M');
    		} else {
    			define('WP_MEMORY_LIMIT', '40M');
    		}
    	}

    Note WordPress limits the memory regardless of your php.ini setting!

    For Snapshot it simply reports the value of the WP_MEMORY_LIMIT define. On that same Settings page, below that 'System Info' box, you should see another metabox 'Memory Limit'. Here you can override the WP_MEMORY_LIMIT defined. The difference is this. The difference is when you set the WP_MEMORY_LIMIT it effect all of your site. When you set the Memory Limit within Snapshot it only effects the backup processing.

    Read more about the Memory Limit setting and other wp-config.php settings
    http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

    I have purposefully disabled wp_cron for another plugin which I have switched from wp_cron to real system cron, is there any chance to get a sample cron entry so I can use system cron instead of wp_cron?

    No, There is no direct way to call snapshot. Can you setup a UNIX crontab to call the wp-cron.php in your site root? My understanding is this is the suggested method when disabling the automatic cron on page loads.

  • Ovidiu

    Thanks for clarifying a few things, so you are saying that wordpress without multisite automatically restricts itself to 40M regardless of the PHP setting???

    Regarding the disabled wp_cron:

    I double checked and you are right. I actually am calling wp_cron every 2 hours via this cron job:
    0 */2 * * * /usr/bin/curl http://www.knightsenglish.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1
    Will that do for snapshots and btw. is there a way for the plugin to recognize this cron job and not show a warning? Just curios :slight_smile:

  • Paul

    Thanks for clarifying a few things, so you are saying that wordpress without multisite automatically restricts itself to 40M regardless of the PHP setting???

    Correct. That is my understanding as I've seen in the code I provided as well as on various sites I've worked on. The 40Mb limit is new in WP 3.5 as it used to be 32Mb. From my reading on this the limit is for a basic WP system running the default TwentyTwelve theme and no plugins. So as you start adding more and more plugins and fancy theme the memory requirements increases. I'm not aware of a way to tell WP to just use the php.ini value.

    Regarding the disabled wp_cron Will that do for snapshots and btw. is there a way for the plugin to recognize this cron job and not show a warning?

    Yes, it should let Snapshot do it's thing. But to be sure try installing a Cron view plugin http://wordpress.org/extend/plugins/search.php?q=cron You should be able to see a listing for the snapshot cron items. I've not fully explored this setup under my development environments.

    As for the warning and having Snapshot know about the cron entry I might add some logic such that you can add a define to your wp-config that tells snapshot you are aware your WP_CRON is disabled. That warning is there like the sessions warning because some hosting seem to turn thee off be default.

    Good luck. Let me know if you run into any more issues with Snapshot.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.