brazzers.com
casino siteleri
Computers and Technology

How to Increase WP Memory Limit

WordPress works straight out of the box, and for the most part, all the technical aspects that may cause errors or obstacles will be coming from the server side, which means that whenever you run into problems such as Memory Limit or File Upload Size Limit; you need to optimize your server configuration and settings to reflect proper changes. We will look at both in this quick tutorial.

Increase File Upload Size Limit 

First, we have the very common error on upload file size limit: The uploaded file exceeds the upload_max_filesize directive in php.ini

This error message is quite self-explanatory in its own nature. You’re trying to upload files that are bigger in size than what is specified within the PHP.ini config file, and the one way to fix it is to adjust the config file to reflect the file size that you prefer. Each server has their PHP.ini file located in different locations, so you have to use locate php.ini on your server, or use the hosting management panel that you have from your hosting company.

Now we discuss how to increase wp memory limit. Once you’re live editing PHP.ini, you can add for example the following lines of code:

upload_max_filesize = 100M

post_max_size = 200M

max_execution_time = 180

This code should take full care of any further issues with upload files that are bigger in size, and you can always change the values to reflect the size of the files that you’re going to be uploading as well. We have also heard of reports from several users that sometimes editing their PHP.ini file doesn’t actually work, and that it’s worth trying to change the values using the .htaccess file you can find in our web root directory.

Open the .htaccess file and for example add the following lines of code:

php_value upload_max_filesize 100M

php_value post_max_size 200M

php_value max_execution_time 180

php_value max_input_time 180

Either one should work, and if it doesn’t – you will have to reach out to your hosting company and talk to them about what the issue could be.

Increase your Memory Limit

The second issue we keep hearing about and know relates to File Size Upload Limit is Memory Limit; which basically means that the server is trying to complete an action that requires more allocated memory than currently has been put in place. It can be fixed just as easily. You can follow the same steps as discussed above, and add the following values:

Change in the PHP.ini file:

memory_limit = 1024M

In case that doesn’t work, add to .htaccess:

php_value memory_limit 1024M

And once again, remember that you can change those limits according to the resources available on your server. And if neither of those worked for you, the last resort would be to edit the wp-config.php file directly by adding the following line of code:

define(‘WP_MEMORY_LIMIT’, ‘1024M’);

And this should do the trick. There is no reason for any of these not to work, unless there are strict limitations set in place by your hosting company, which is where you should be headed if your errors are still persisting. Hopefully these tips are helpful to assist you change your file upload limits and memory limits in WordPress.

The default memory limit for WordPress is 32 MB. It is very common to exceed this limit and get the error Fatal error: Allowed memory size. The fatal error message looks similar to this one:

Fatal error: Allowed memory size of 23556632 bytes exhausted (tried to allocate 3349917 bytes) in /home/xxxxx/public_html/wp-includes/plugin.php on line xxx

To increase the WordPress allowed memory size for your website:

Open wp-config.php, which by default is located in the root WordPress directory.

Find the following line near the end of the file:

/* That’s all, stop editing! Happy blogging. */

Just above that line, add the following line:

define(‘WP_MEMORY_LIMIT’, ’64M’);

Save your changes. 

You can also increase memory to a higher number, and you can also increase the memory limit for admin tasks, as described in the WordPress codex. If you’re still receiving the error after this fix, contact your web host provider or server administrator for their help.

Related Articles

Back to top button