Upgrade 11.0.4->11.0.5 Allowed memory size of 2097152 bytes exhausted

Nextcloud version 11.0.4
Operating system and version Ubuntu 16.04.1
Apache or nginx version 2.4.18 :
PHP version 7.0.22
Is this the first time you’ve seen this error?:yes

Can you reliably replicate it? (If so, please outline steps):
Upgrade from Upgrade 11.0.4->11.0.5 failed see next point

The issue you are facing:
root@blabla:/var/www/blabla# sudo -u www-data php occ upgrade
PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 73728 bytes) in /var/www/blabla/3rdparty/composer/autoload_static.php on line 323

I tried to give php more memory (up to 4096MB) and I could see it using phpinfo() - but the output of
sudo -u www-data php occ upgrade was always the same "PHP Fatal error: Allowed memory size of 2097152 bytes exhausted"
as if nothing happens…

What could i try?

If you start php from terminal, you probably must edit a different php.ini (in /etc/php/7.0/cli).

I did this - i edited every php.ini under “…/7.0/cli and” “…/7.0/apche2” to “memory_limit = 4096M”…

Same problem here when I try to execute a php script from command line.

Increased memory_limit to 1024M in both php.ini, cli and apache2 folders. Phpinfo verified the change.

Error message keeps the same amount of memory 2097152 as if nothing has changed.

In my case, I try to execute a cron candidate script of mautic to integrate with Sugarsuite. This is the command that gives the error:

php /var/www/mydomain.com/public_html/app/console mautic:integration:fetchleads --fetch-all --integration=Sugarcrm

And this is the error:

PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 4096 bytes) in /var/www/mydomain.com/public_html/vendor/composer/autoload_static.php on line 3681

I’d appreciate any help!

If you run the php command, you can show the used ini files:

php --ini