Increasing the PHP Memory Limits

  • Support
    HB-Themes
    April 27, 2019 at 11:39 am #138616

    In general this is not a WordPress issue, but a server side’s setting. Hosting providers put memory limits due to efficiency reasons. The limit is fair solution for server’s resource allocation problem; However, nowadays the default limits are often too low.

    Raise the WordPress memory limit by editing wp-config.php file

    Open wp-config.php, by default, located in the WordPress site’s root directory. You can use FTP or your hosting’s File Manager to navigate to that file.

    Find the line at the end of the file that says: That’s all, stop editing! Happy blogging.

    Add the following code:

    define('WP_MEMORY_LIMIT', '256M');
    set_time_limit(400);

    This code tells WordPress to increase the PHP memory limit to 256MB and increases max_execution_time to 400 seconds.

    WordPress memory limit can be different from the limit on the server side – you need to set WordPress memory limit regardless of server memory settings.

    Raise the server memory limit by editing php.ini file

    In most cases if you are on a shared host, then you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. If you have access to the php.ini file, find the line of code where the memory limit is allocated and raise the value, let’s say to 256MB. It will look like this:

    memory_limit = 256M

    We also suggest looking for max_execution_time and raising that limit as well:

    max_execution_time = 400

    Alternatively, you may try to increase memory limit by editing .htaccess file by adding the following code:

    php_value memory_limit 256M
    php_value max_execution_time 400

    Sorry, this forum is for verified users only. Please Login or Register to continue

Comments are closed.