Title: rules.php memory limit
Last modified: September 10, 2018

---

# rules.php memory limit

 *  Resolved [geofones](https://wordpress.org/support/users/geofones/)
 * (@geofones)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/rules-php-memory-limit/)
 * Whilst trying to upload a gpx cycle trail using the WP GPX plugin I get the following
   error:
    _ Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
   to allocate 35367577 bytes) in /wp-content/plugins/wordfence/vendor/wordfence/
   wf-waf/src/lib/rules.php on line 1600
 * Is there any way of increasing the limit in wordfence please
    Memory: 107.5 of
   256 MB (42%) | WP LIMIT: 40 MB | PHP 5.6.37 @64BitOS Version 4.9.8
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Frules-php-memory-limit%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [WFSupport](https://wordpress.org/support/users/wfsupport/)
 * (@wfsupport)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/rules-php-memory-limit/#post-10682838)
 * This is a question that comes up every so often from people who have growing 
   websites. This issue is not a Wordfence error but simply indicates that you need
   to increase your site’s memory available to php. Usually your hosting provider
   will edit your php.ini file to increase the memory_limit parameter, and they 
   may also have to increase your web server memory limit along with any operating
   system limits they have. They can define this in the php.ini file (usually found
   in /etc on linux systems – check your documentation for windows servers, which
   are currently unsupported by Wordfence).
 *  Look through the file for a line like this: memory_limit = 128M
 * Keep in mind the 128M is probably different. That’s the amount of memory that
   php is allowed to consume. If you have 10 plugins and combined they consume more
   memory than you have allocated, you’re going to have problems. You can assign
   more by increasing this value. (Some of our personal sites have 512M allowed,
   but these are pretty big sites with a substantial number of hits and plugins).
 * Make sure and restart httpd (apache) after making changes if you manage your 
   own server. If you don’t the hosting provider will do this for you..
 * Our system requirements specify 128m being needed (though we use less) but we’re
   seeing many WordPress specific hosting providers allowing 256m by default to 
   give wordpress room to breathe.
 * There are a few other things you can try.
 * 1. In your wp-config.php you can try setting the amount of memory WordPress can
   use to a higher number. Example:
 * define( ‘WP_MEMORY_LIMIT’, ’96M’ );
 * define( ‘WP_MAX_MEMORY_LIMIT’, ‘256M’ );
 * 2. On the Wordfence Scan > Scan Options and Scheduling in the section “Performance
   Options” change the setting “How much memory should Wordfence request when scanning”
   to 256 if it’s not already set at that.
 * 3. Go through all your plugins and make sure you are actually using all of them.
   Every plugin you have activated uses a part of your available memory so the more
   plugins you have active the more memory your site needs.
 * Let me know of any of this helped the problem.
 * Tim
 *  [detoris](https://wordpress.org/support/users/detoris/)
 * (@detoris)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/rules-php-memory-limit/#post-10685479)
 * My web hosting package has 256MB on my hosting provider.
    I added the following
   in wp-config.php to have 128 MB instead of 40 MB. define(‘WP_MEMORY_LIMIT’, ‘
   128M’); This works without problems.
 * Do I have to add the following and what else would that mean?
    define( ‘WP_MAX_MEMORY_LIMIT’,‘
   256M’ );
 * thank you very much
 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/rules-php-memory-limit/#post-10701540)
 * Hi [@detoris](https://wordpress.org/support/users/detoris/)
 * “WP_MAX_MEMORY_LIMIT” is related to tasks run in the admin dashboard as some 
   tasks might require more memory than what you have set for “WP_MEMORY_LIMIT”,
   in your case, I don’t think you need to define “WP_MAX_MEMORY_LIMIT” parameter.
 * Thanks.
 *  [detoris](https://wordpress.org/support/users/detoris/)
 * (@detoris)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/rules-php-memory-limit/#post-10702041)
 * Thank you for the explanation.

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

The topic ‘rules.php memory limit’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [allowed memory](https://wordpress.org/support/topic-tag/allowed-memory/)

 * 4 replies
 * 4 participants
 * Last reply from: [detoris](https://wordpress.org/support/users/detoris/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/rules-php-memory-limit/#post-10702041)
 * Status: resolved