Platform: Wordpress 4.5.2 | PHP version: 5.5.9 | Mysql: 5.6.30 | Running: Ubuntu 14.04.4

Yesterday I successfully upgraded to CiviCRM 4.6.16, no errors during upgrade, everything went smoothly, except the cron job is failing with the next error:

PHP Fatal error:  
  Allowed memory size of 262144 bytes exhausted (tried to allocate 1920 bytes) in
  on line 226

PHP memory limit is set to 512M

line 226 at civicrm/bin/cli.class.php

The cron job runs every 5 minutes and looks like this:

php /var/www/site/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -s site -u user -p password -e Job -a execute

If I run the job from the API explorer, it runs successfully with no errors, it also runs successfully if I execute a job with Execute now in the Scheduled jobs page.

Any input is highly appreciated.

1 Answer 1


So CLI's memory limit was set to -1 like this:

memory_limit = -1 // no memory limit

Setting the limit to other than no limit solved the issue.

I'm not sure why this happened as CLI's memory limit was always set to -1 from the very first day I configured this server 2 years ago.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.