Can't increase memory_limit on PHP

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version : 24.0.12
Operating system and version : “Ubuntu 22.04”
Apache: Apache/2.4.52`
PHP version: 7.4

Issue:
No matter how many times i update the php.ini file to increase the memory_limit size, then restart the php7.4-fpm service, the information displayed on web interface still holds the same 128M memory limit.

I’m not a web admin and I’ve tried updating the information in both directories for /cli and /fpm using root, and restarting apache2 service but still no success.

How can I properly upgrade the memory limit? Or how can I upgrade the PHP server to 8 if that’s recommended?

Thanks

just an idea

In this post the solution was

sudo a2dismod php7.4
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.4-fpm

sudo systemctl restart apache2
sudo systemctl restart php7.4-fpm

and have a look at “all” your php-fpm settings

# grep -R “memory_limit” /etc/php/

check if any “memory_limit” value is out of your prefered range

1 Like

The key bit here was likely this^^^.

When using FPM mode, PHP runs as a separate process from the web service (Apache in this case). So restarting the Apache service wasn’t sufficient to activate the PHP ini changes.

This is in contrast to non-FPM mode, like when using mod_php, where PHP is directly embedded within the Apache server.

1 Like