provide a way to increase memory_limit for scheduled tasks
I'm experiencing an issue that seems fairly common for magento2 developers with plesk. When I try to add the cron job for magento 2 I hit a memory exhausted error at 128MB.
The proposed way in
doesn't work for this case.
For example I'm setting the cron job like this
/usr/bin/env php -d memory_limit=1G "httpdocs/bin/magento" cron:run
Will result in
Ran jobs by schedule. PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /httpdocs/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 228 PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /httpdocs/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 228
Expected result would be to run the script normally.
Currently I had to work around the issue by editing the php file and explicitly set the memory_limit.
Note: only feature requests are allowed here, so we would appreciate if you post bugs and issues on our forum at https://talk.plesk.com. We are closing this request, since it does not contain any feature suggestions.
—
IG