Answers.Body: <p>What I did to fix:</p>
  
  <ol>
  <li>My php path was wrong. Should have been:</li>
  </ol>
  
  <p>/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</p>
  
  <ol start="2">
  <li><p>Then I created a new wordpress role using a role plugin, "civimailrole" with the only privilege "Access CiviMail".</p></li>
  <li><p>Then created new wordpress user "civimailusr" and assigned only the role "civimailrole".</p></li>
  <li><p>Used the new user and password in the command for CPanel cron job editor.</p></li>
  <li><p>Sent test mailing to myself, worked.</p></li>
  </ol>
  
  <p>I would appreciate any comments on any security issues for this setup. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-20T18:12:51.997Z
Answers.Text: Did you check out this thread: http://civicrm.stackexchange.com/questions/9130/cron-job-with-shared-hosting-cpanel ?
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-10T20:47:44.517Z
Answers.Text: I later created another thread with more information: http://civicrm.stackexchange.com/questions/11027/does-anyone-have-a-working-example-for-civimail-bulk-emails-on-wordpress-and-4-7/11059#11059
Answers.UserDisplayName: P a u l
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-05T04:41:23.637Z
Answers.LastActivityDate: 2015-05-05T04:41:23.637Z
Answers.UserDisplayName: P a u l
Body: <p>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:</p>
  
  <p>/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</p>
  
  <p>This doesn't work. Cron returns (via email):</p>
  
  <p>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</p>
  
Tags: <civimail><wordpress><4.5.6>
Title: Creating CiviMail cron job in CPanel
ThreadText: # Creating CiviMail cron job in CPanel
  
  (Asked by: username_0 on 2015-05-05)
  
  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 username_0 -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
  
  **Tags:** civimail, wordpress, 4.5.6
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-05-05. Score: 2
  
  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
  
  2. Then I created a new wordpress role using a role plugin, "civimailrole" with the only privilege "Access CiviMail".
  3. Then created new wordpress user "civimailusr" and assigned only the role "civimailrole".
  4. Used the new user and password in the command for CPanel cron job editor.
  5. Sent test mailing to myself, worked.
  
  I would appreciate any comments on any security issues for this setup.
  
  > **Comments:**
  > **username_1**: Did you check out this thread: http://civicrm.stackexchange.com/questions/9130/cron-job-with-shared-hosting-cpanel ?  
  > **username_0**: I later created another thread with more information: http://civicrm.stackexchange.com/questions/11027/does-anyone-have-a-working-example-for-civimail-bulk-emails-on-wordpress-and-4-7/11059#11059  
  
  ---
  
  