• Hi,
    I would like to know how to change the PHP 8.0 and 7.4 memory limit.
    Ihad done this for the PHP 7.3 version but since the upgrade, it is not anymore working and I can’t find which file to change to do this in my Raspbian distibution.

    Thanks a lot for your answer,

    Regards,
    Stephane

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • In your WordPress installation, you can do it from the wp-config.php file. Insert this code in that file:

    /** Memory Limit */
    define('WP_MEMORY_LIMIT', '256M');
    define( 'WP_MAX_MEMORY_LIMIT', '256M' );

    Add it before this line:

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

    Thread Starter smart

    (@smadrange)

    Thanks a lot Faisal,

    I already have added those lines in the /var/www/wordpress/wp-config.php

    They are still inside /var/www/wordpress/wp-config.php and when I open it it says “This file is meant to be read-only”…

    So I zm wondering if with PHP 8.0 or 7.4 there is something else to do ???

    Thanks again,

    Stephane

    Hi Stephane,
    You can modify the php.ini file to increase the memory limit. Simply add the following code and then restart the Apache server (if you’re using it). Doing so will help ensure that your server has enough memory to handle the load.

    php.ini code:
    memory_limit = 256M

    Server restart command:
    sudo service apache2 restart

    After completing these steps, you should have successfully increased the WP Memory limit from the php.ini file.

    Thread Starter smart

    (@smadrange)

    Hi Faisal,

    Thanks for your answer, I already had this memory_limit set to 256M.

    My WordPress is working under Unohost distribution, so there are 7.4 and 8.0 PHP version, but no Apapche server.

    But I found the solution, the file to change is wordpress.conf and then restart php:

    sudo nano /etc/php/8.0/fpm/pool.d/wordpress.conf
    memory_limit = 256M
    sudo systemctl restart php8.0-fpm

    And now it works, in the health / Server information, the PHP memory limit is now set to 256M.

    Thanks for the help anyway !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change PHP Memory limit from 64M to 256M ?’ is closed to new replies.