How to Increase Your PHP Memory Limit and Execution Time

A product feed may sometimes get stuck during generation. Most of the time, it gets stuck when the feed generation process reaches 10%. 

However, multiple reasons may cause this issue. 

To resolve the “Processing 10%” feed generation stuck error, we suggest increasing the PHP memory limit and execution time.

And yes, you can do that in several ways. Below are the most common ways you can leverage to increase the PHP memory limit as well as execution time: 

  1. Editing your wp-config.php file. 
  2. Editing your PHP.ini file.
  3. Editing your .htaccess file.
  4. By using a plugin.
  5. From your cPanel
  6. Contacting your hosting provider

Let’s talk about these methods briefly. 

Editing wp-config.php file:

To increase your WP-Memory Limit, simply edit your wp-config.php file. You’ll find the wp-config.php in the following directory:

app > public > wp-config.php

To make the necessary changes, please open the wp-config.php file and add or rewrite the specified text string:

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

I am increasing my memory limit to 512MB, which is within the limit of my hosting plan. You can increase your memory limit as much as your hosting plan allows.

Editing PHP.ini File: 

To modify the PHP.ini file, follow these steps:

  • Locate the PHP.ini file on your server. The file is usually located in the root directory or in a subdirectory named “php” or “phpX” (where X represents the PHP version).
  • Open the PHP.ini file using a text editor.
  • Look for the line that says memory_limit = 256M and modify it to memory_limit = 512M. This change increases the memory limit allocated to PHP.
  • It is also recommended to modify the max_execution_time line. This line specifies the maximum time in seconds that a PHP script can run. If this time limit is exceeded, PHP returns an error. Increasing this value allows scripts more time to execute, which can be beneficial for memory-intensive services and plugins.
  • Locate the line max_execution_time = 300 and change it to a higher value, such as max_execution_time = 600 or even max_execution_time = 900 if necessary.
  • Save the changes to the PHP.ini file.

Edit .htaccess file:

If editing the PHP.ini or config file doesn’t solve the problem, you can resort to editing the .htaccess file. This file is hidden and can be accessed through FTP or SFTP by enabling the display of hidden files. Locate the line “php_value memory_limit” in the .htaccess file and add the desired value (e.g., 256M, 512M). Save the file and remember to clear your cache before checking if the issue is resolved.

Using Plugins for Increasing Memory Limit: 

If editing configuration files or modifying the .htaccess file is not feasible, you can increase your PHP memory limit using a plugin like “WP Memory Limit, Memory Usage, Server Memory, and Health” for WordPress versions 5.2 or higher. This plugin allows you to adjust the available PHP memory without the need to directly access or modify any files. Simply install and activate the plugin, then use its interface to adjust the PHP memory limit according to your needs.

From your cPanel:

With cPanel access, you can easily increase PHP Memory Limit and Execution time. After logging in, navigate to the Software section and select MultiPHP INI Editor. 

Choose the PHP version, then modify the “memory_limit” and “max_execution_time” values according to your needs. Save the changes to apply them. This allows you to adjust PHP settings without manually editing files, providing a convenient solution for increasing memory and execution time limits following this: 

Contacting Hosting Provider:

If all other methods fail or if you prefer a hassle-free solution, the final option is to contact your hosting provider and request an increase in your WordPress PHP memory limit and Execution time. Depending on the type of hosting you have (shared, dedicated, or virtual private server), this request may be a straightforward fix or not available as a service. Reach out to your hosting provider’s support team and inquire about the possibility of increasing your PHP memory limit, providing them with the necessary details and explaining the issue you are facing. They will be able to guide you further and let you know if this adjustment can be made.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.