Computers and Technology

Increase WP Memory Limit

Increase WP Memory Limit
Increase WP Memory Limit
125views

WP E-Signature is a robust document signing application… that happens to be powered by WordPress. Unlike smaller WordPress plugins, WP E-Signature requires a minimum of 96MB memory to process your documents. You have a knowledge of how to increase wp memory limit?

MPDF is the current library that our plugin uses to generate PDF’s, which takes up majority of the memory. Your PDF’s are not saved on your ftp server (for security reasons), therefore our application generates a new PDF file upon demand…and each PDF generation request requires memory.

You can verify this by running a simple PHP script. You’ll need to create a file info.php in a root directory of your website (if you happen to have the website on CloudAccess the proper directory is: httpdocs) and put there:

<?php
phpinfo();
?>

To learn more about mpdf memory you can checkout this article:
https://mpdf.github.io/troubleshooting/memory-problems.html

OPTION 1: Edit wp-config.php file

Since version 2.5, WordPress was given a new WP_MEMORY_LIMIT variable. So, by default the limit is set to 40MB (and 64MB when it is installed on a multisite). This limit is hard coded in a file in the WordPress install: default-constants.php which is located in the wp-includes directory.

In most cases you don’t need to worry about it. However, sometimes WordPress installs disregard the memory_limit set for our platform and blindly takes WP_MEMORY_LIMIT that is set by wp-includes/default-constants.php (40MB). In this case you’ll need to do a couple things:

To increase memory for your WordPress website you can follow these steps. Login to your FTP and locate your “wp-config.php” file which will be in the root folder (or main folder) of where your website lives.

  1. Add the following code snippet (or edit the code if it already exists in your wp-config.php file):

define(‘WP_MEMORY_LIMIT’, ’96M’);
define(‘WP_MAX_MEMORY_LIMIT’, ’96M’);

  1. Change lines 22-26 of wp-includes/default-constants.php to the following snippet:

if ( is_multisite() ) {
define(‘WP_MEMORY_LIMIT’, ‘256M’);
}
else {
define(‘WP_MEMORY_LIMIT’, ‘256M’);
}

WordPress memory is often times different than server allocation memory – it’s for this reason that you need to define this 96M memory limit regardless of server memory settings

OPTION 2: Update your PHP.ini file

If you have access to your PHP.ini file, locate the following line in PHP.ini

If your line shows 32M or 64M try 96M.

memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

OPTION 3: Update your .htaccess file

If editing your wp-config or PHP.ini file does not work, you can try editing your .htaccess file which is located in the root (or main) folder of your website via ftp.

Add (or edit) the following code snippet in your .htaccess file.

php_value memory_limit 64M

OPTION 4: Contact your host

If none of these three options resolves the memory allocation limit, please contact your web host and work with them directly to troubleshoot the issue.

Leave a Response