I am on shared linux hosting and using the CPanel cron job setup page. Set to run every 1/2 hour. I just need the command line, and I consulted the books for more info. The command line I came up with is:

/usr/bin/php -q /home/acct123/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -j -s mydomain.org -u Paul -p password -e Job -a process_mailing

This doesn't work. Cron returns (via email):

PHP Fatal error: cli.php can only be run from command line. in /home/acct123/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.class.php on line 86

1 Answer 1


What I did to fix:

  1. My php path was wrong. Should have been:

/usr/local/bin/php -q /home/acct123/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -j -s mydomain.org -u user -p password -e Job -a process_mailing

  1. Then I created a new wordpress role using a role plugin, "civimailrole" with the only privilege "Access CiviMail".

  2. Then created new wordpress user "civimailusr" and assigned only the role "civimailrole".

  3. Used the new user and password in the command for CPanel cron job editor.

  4. Sent test mailing to myself, worked.

I would appreciate any comments on any security issues for this setup.


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.