Answers.Body: <p>No idea why PHP cli stopped working. Purists can chastise me for copping out, but I never figured out the PHP cli problem. Instead, I toyed around with wp-cli and ultimately got that working. After testing command lines through SSH, the first glimmer of success came from <code>wp --user=[REDACTED] --url=https://[REDACTED] --path=/[REDACTED]/ civicrm api job.execute auth=0</code></p>
  
  <p>At this point, it was a (relatively) simple matter of discovering the specific path to wp-cli. When that specific path appeared in place of <code>wp</code> in the CRON job command line, I received the desired email from the cron daemon indicating the tasks had completed.</p>
  
  <p>So while this may not technically answer my original question, Done is Good, and I'm not going to pursue it further unless and until my CRON jobs again cease running.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-27T01:15:13.390Z
Answers.Text: Hi Pronay,
  
  Glad you got it fixed in the end.
  
  Did you log a bug? It might be worth referencing this thread.
  
  If you haven't yet logged a bug, here, let me link it for you: https://issues.civicrm.org/jira/secure/CreateIssue!default.jspa
Answers.UserDisplayName: JohnFF
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-28T19:21:44.777Z
Answers.Text: That success was short-lived. [This new question](https://civicrm.stackexchange.com/questions/19661/another-cron-headache-fwrite-expects-parameter-1-to-be-resource-string-given) describes what happened after a few days of smooth CRON operation via wp-cli.
Answers.UserDisplayName: Prónay
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-20T00:08:41.387Z
Answers.LastActivityDate: 2017-07-20T00:08:41.387Z
Answers.UserDisplayName: Prónay
Answers.Body: <p>Mine works: Whack this in your crontab -e</p>
  
  <p>00 * * * * cd /var/www/drupal &amp;&amp; /usr/local/bin/drush --quiet civicrm-api -u 1 job.execute</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-21T15:00:28.577Z
Answers.Text: Thanks John. Will keep that in mind if CRON malfunctions again. Still, I'm skeptical as to whether drush is the way to go within the WordPress environment.
Answers.UserDisplayName: Prónay
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-20T00:24:58.823Z
Answers.LastActivityDate: 2017-07-20T00:24:58.823Z
Answers.UserDisplayName: JohnFF
Body: <p>Soon after upgrading from 4.7.17 to 4.7.19, my WordPress CiviCRM stopped running CRON jobs. No problem, I thought -- check the permissions on cli.php and sure enough, they'd been tightened. I changed them back to 0755, and assumed I was done. But even after initiating a manual run of scheduled jobs, the CRON jobs not running error came right back.</p>
  
  <p>Any idea what's causing this?</p>
  
  <p>18 July -- UPDATE:</p>
  
  <p>While compulsively fiddling with my CRON command, the cron daemon sent me this:</p>
  
  <pre><code>&lt;code&gt;&lt;span style="color: #000000"&gt;
  &lt;span style="color: #0000BB"&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #FF8000"&gt;/*&lt;br /&gt;&amp;nbsp;+--------------------------------------------------------------------+&lt;br /&gt;&amp;nbsp;|&amp;nbsp;CiviCRM&amp;nbsp;version&amp;nbsp;4.7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;+--------------------------------------------------------------------+&lt;br /&gt;&amp;nbsp;|&amp;nbsp;Copyright&amp;nbsp;Tech&amp;nbsp;To&amp;nbsp;The&amp;nbsp;People&amp;nbsp;http:tttp.eu&amp;nbsp;(c)&amp;nbsp;2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;+--------------------------------------------------------------------+&lt;br /&gt;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;CiviCRM&amp;nbsp;is&amp;nbsp;free&amp;nbsp;software;&amp;nbsp;you&amp;nbsp;can&amp;nbsp;copy,&amp;nbsp;modify,&amp;nbsp;and&amp;nbsp;distribute&amp;nbsp;it&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;under&amp;nbsp;the&amp;nbsp;terms&amp;nbsp;of&amp;nbsp;the&amp;nbsp;GNU&amp;nbsp;Affero&amp;nbsp;General&amp;nbsp;Public&amp;nbsp;License&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;Version&amp;nbsp;3,&amp;nbsp;19&amp;nbsp;November&amp;nbsp;2007&amp;nbsp;and&amp;nbsp;the&amp;nbsp;CiviCRM&amp;nbsp;Licensing&amp;nbsp;Exception.&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;CiviCRM&amp;nbsp;is&amp;nbsp;distributed&amp;nbsp;in&amp;nbsp;the&amp;nbsp;hope&amp;nbsp;that&amp;nbsp;it&amp;nbsp;will&amp;nbsp;be&amp;nbsp;useful,&amp;nbsp;but&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;WITHOUT&amp;nbsp;ANY&amp;nbsp;WARRANTY;&amp;nbsp;without&amp;nbsp;even&amp;nbsp;the&amp;nbsp;implied&amp;nbsp;warranty&amp;nbsp;of&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;MERCHANTABILITY&amp;nbsp;or&amp;nbsp;FITNESS&amp;nbsp;FOR&amp;nbsp;A&amp;nbsp;PARTICULAR&amp;nbsp;PURPOSE.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;See&amp;nbsp;the&amp;nbsp;GNU&amp;nbsp;Affero&amp;nbsp;General&amp;nbsp;Public&amp;nbsp;License&amp;nbsp;for&amp;nbsp;more&amp;nbsp;details.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;You&amp;nbsp;should&amp;nbsp;have&amp;nbsp;received&amp;nbsp;a&amp;nbsp;copy&amp;nbsp;of&amp;nbsp;the&amp;nbsp;GNU&amp;nbsp;Affero&amp;nbsp;General&amp;nbsp;Public&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;License&amp;nbsp;and&amp;nbsp;the&amp;nbsp;CiviCRM&amp;nbsp;Licensing&amp;nbsp;Exception&amp;nbsp;along&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;with&amp;nbsp;this&amp;nbsp;program;&amp;nbsp;if&amp;nbsp;not,&amp;nbsp;contact&amp;nbsp;CiviCRM&amp;nbsp;LLC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;at&amp;nbsp;info[AT]civicrm[DOT]org.&amp;nbsp;If&amp;nbsp;you&amp;nbsp;have&amp;nbsp;questions&amp;nbsp;about&amp;nbsp;the&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;GNU&amp;nbsp;Affero&amp;nbsp;General&amp;nbsp;Public&amp;nbsp;License&amp;nbsp;or&amp;nbsp;the&amp;nbsp;licensing&amp;nbsp;of&amp;nbsp;CiviCRM,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;|&amp;nbsp;see&amp;nbsp;the&amp;nbsp;CiviCRM&amp;nbsp;license&amp;nbsp;FAQ&amp;nbsp;at&amp;nbsp;http://civicrm.org/licensing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br /&gt;&amp;nbsp;+--------------------------------------------------------------------+&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #007700"&gt;require_once&amp;nbsp;&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'cli.class.php'&lt;/span&gt;&lt;span style="color: #007700"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$cli&amp;nbsp;&lt;/span&gt;&lt;span style="color: #007700"&gt;=&amp;nbsp;new&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;civicrm_Cli&lt;/span&gt;&lt;span style="color: #007700"&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$cli&lt;/span&gt;&lt;span style="color: #007700"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;initialize&lt;/span&gt;&lt;span style="color: #007700"&gt;()&amp;nbsp;||&amp;nbsp;die(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Died&amp;nbsp;during&amp;nbsp;initialization'&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;$cli&lt;/span&gt;&lt;span style="color: #007700"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color: #0000BB"&gt;callApi&lt;/span&gt;&lt;span style="color: #007700"&gt;()&amp;nbsp;||&amp;nbsp;die(&lt;/span&gt;&lt;span style="color: #DD0000"&gt;'Died&amp;nbsp;during&amp;nbsp;callApi'&lt;/span&gt;&lt;span style="color: #007700"&gt;);&lt;br /&gt;&lt;/span&gt;
  &lt;/span&gt;
  &lt;/code&gt;
  </code></pre>
  
  <p>That's what it looked like in the email I received. Now here it is again when I don't add the code {} formatting in the wysiwyg:</p>
  
  <p><code>
  &lt;?php<br />/<em><br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;|&nbsp;CiviCRM&nbsp;version&nbsp;4.7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;|&nbsp;Copyright&nbsp;Tech&nbsp;To&nbsp;The&nbsp;People&nbsp;http:tttp.eu&nbsp;(c)&nbsp;2008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;CiviCRM&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;copy,&nbsp;modify,&nbsp;and&nbsp;distribute&nbsp;it&nbsp;&nbsp;|<br />&nbsp;|&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;License&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;Version&nbsp;3,&nbsp;19&nbsp;November&nbsp;2007&nbsp;and&nbsp;the&nbsp;CiviCRM&nbsp;Licensing&nbsp;Exception.&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;CiviCRM&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,&nbsp;but&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;See&nbsp;the&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;License&nbsp;and&nbsp;the&nbsp;CiviCRM&nbsp;Licensing&nbsp;Exception&nbsp;along&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;contact&nbsp;CiviCRM&nbsp;LLC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;at&nbsp;info[AT]civicrm[DOT]org.&nbsp;If&nbsp;you&nbsp;have&nbsp;questions&nbsp;about&nbsp;the&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;License&nbsp;or&nbsp;the&nbsp;licensing&nbsp;of&nbsp;CiviCRM,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;see&nbsp;the&nbsp;CiviCRM&nbsp;license&nbsp;FAQ&nbsp;at&nbsp;<a href="http://civicrm.org/licensing&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|" rel="nofollow noreferrer">http://civicrm.org/licensing&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|</a><br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;</em>/<br /><br /><br />require_once&nbsp;'cli.class.php';<br />$cli&nbsp;=&nbsp;new&nbsp;civicrm_Cli();<br />$cli-&gt;initialize()&nbsp;||&nbsp;die('Died&nbsp;during&nbsp;initialization');<br />$cli-&gt;callApi()&nbsp;||&nbsp;die('Died&nbsp;during&nbsp;callApi');<br />
  
  </code></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-18T02:11:23.317Z
Comments.Text: Had to put out some fires, and finally am getting back to this one. Verified the username in both CRON commands matches a valid entry in the civicrm_uf_match table. Still getting "permission denied." Activated Twenty Seventeen theme. Still getting "permission denied."
  Also, dunno if it's related, but lately when I run scheduled jobs manually, I get a list of subject lines from emails processed through our mail domain. When I click Back, the Civi scheduled jobs screen loads and a success message pops up. Weird.
  All this to say I still can't get cli.php or cron.php to behave correctly. Ideas?
Comments.UserDisplayName: Prónay
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-18T19:41:38.243Z
Comments.Text: I get a different error to you: https://civicrm.stackexchange.com/questions/19576/cron-fail-sessions
Comments.UserDisplayName: JohnFF
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-18T20:24:52.300Z
Comments.Text: Good luck with your CRON headache, John. Don't know if yours and mine are related other than the upshot of both is scheduled tasks don't run. This would be easier if I could find some detailed error reporting in the server logs, but the failed CRON jobs don't seem to be documented. Maybe time to turn on debugging ... ?
Comments.UserDisplayName: Prónay
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-18T20:25:28.763Z
Comments.Text: One reason I use the wp-cli method is that i can call the cron job with flags to tell wp to skip themes '--skip-themes' and I can also add a yml file and not load any plugins except CiviCRM.   This way any errors that a plugin or theme introduces that stops civiCRM are eliminated.
Comments.UserDisplayName: Kevin Cristiano
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-28T03:28:09.443Z
Comments.Text: Still spinning my wheels here. Confirmed that CRON is running on the server, and appears to be starting cli.php -- but the script no longer works as expected (due to update?), and because it doesn't complete its task, there's no email sent by the CRON Daemon to tell me what may have gone wrong. So I'm running the scheduled jobs manually every day or two. Inconvenient, but for the time being it works. I've compared the contents of civicrm/civicrm/bin on the server to those on my local system, and they're identical. What else should I try?
Comments.UserDisplayName: Prónay
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-28T12:25:59.270Z
Comments.Text: I've had issues with cli.php dying for two reasons:
  
  1 - The theme throwing fatal errors. We were using PageLines, which had some issues when bootstrapped like cli.php wants to use it. You could try with a basic WP theme.
  2 - make sure that the cron user has a valid entry in the uf_match table
Comments.UserDisplayName: Andrew West
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-28T14:27:25.883Z
Comments.Text: Changed permissions on cli.php and cron.php from 0755 to 0644, and verified the folder containing these scripts was 0755. With permissions set as described, it seems cli.php still does not work unless triggered manually. What next?
Comments.UserDisplayName: Prónay
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-28T17:14:30.170Z
Comments.Text: Just now saw your reply, Andrew -- thank you for the suggestions. I'll look at uf_match and (if that's not the culprit) I'll see if it works when the theme is running Twenty Seventeen. Soon as I've tried that, I'll report back.
Comments.UserDisplayName: Prónay
Tags: <permissions><cron-job><cron>
Title: CRON jobs stopped running after 4.7.19 upgrade, and cli.php is executable
ThreadText: # CRON jobs stopped running after 4.7.19 upgrade, and cli.php is executable
  
  (Asked by: username_0 on 2017-05-23)
  
  Soon after upgrading from 4.7.17 to 4.7.19, my WordPress CiviCRM stopped running CRON jobs. No problem, I thought -- check the permissions on cli.php and sure enough, they'd been tightened. I changed them back to 0755, and assumed I was done. But even after initiating a manual run of scheduled jobs, the CRON jobs not running error came right back.
  
  Any idea what's causing this?
  
  18 July -- UPDATE:
  
  While compulsively fiddling with my CRON command, the cron daemon sent me this:
  
  ```
  <code><span style="color: #000000">
  <span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*<br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;|&nbsp;CiviCRM&nbsp;version&nbsp;4.7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;|&nbsp;Copyright&nbsp;Tech&nbsp;To&nbsp;The&nbsp;People&nbsp;http:tttp.eu&nbsp;(c)&nbsp;2008&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;CiviCRM&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;copy,&nbsp;modify,&nbsp;and&nbsp;distribute&nbsp;it&nbsp;&nbsp;|<br />&nbsp;|&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;License&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;Version&nbsp;3,&nbsp;19&nbsp;November&nbsp;2007&nbsp;and&nbsp;the&nbsp;CiviCRM&nbsp;Licensing&nbsp;Exception.&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;CiviCRM&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,&nbsp;but&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;See&nbsp;the&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;License&nbsp;and&nbsp;the&nbsp;CiviCRM&nbsp;Licensing&nbsp;Exception&nbsp;along&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;with&nbsp;this&nbsp;program;&nbsp;if&nbsp;not,&nbsp;contact&nbsp;CiviCRM&nbsp;LLC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;at&nbsp;info[AT]civicrm[DOT]org.&nbsp;If&nbsp;you&nbsp;have&nbsp;questions&nbsp;about&nbsp;the&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;GNU&nbsp;Affero&nbsp;General&nbsp;Public&nbsp;License&nbsp;or&nbsp;the&nbsp;licensing&nbsp;of&nbsp;CiviCRM,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;|&nbsp;see&nbsp;the&nbsp;CiviCRM&nbsp;license&nbsp;FAQ&nbsp;at&nbsp;http://civicrm.org/licensing&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />&nbsp;+--------------------------------------------------------------------+<br />&nbsp;*/<br /><br /><br /></span><span style="color: #007700">require_once&nbsp;</span><span style="color: #DD0000">'cli.class.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$cli&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">civicrm_Cli</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$cli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">initialize</span><span style="color: #007700">()&nbsp;||&nbsp;die(</span><span style="color: #DD0000">'Died&nbsp;during&nbsp;initialization'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$cli</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">callApi</span><span style="color: #007700">()&nbsp;||&nbsp;die(</span><span style="color: #DD0000">'Died&nbsp;during&nbsp;callApi'</span><span style="color: #007700">);<br /></span>
  </span>
  </code>
  
  ```
  
  That's what it looked like in the email I received. Now here it is again when I don't add the code {} formatting in the wysiwyg:
  
  `<?php  
  /  
   +--------------------------------------------------------------------+  
   | CiviCRM version 4.7                                                |  
   +--------------------------------------------------------------------+  
   | Copyright Tech To The People http:tttp.eu (c) 2008                 |  
   +--------------------------------------------------------------------+  
   |                                                                    |  
   | CiviCRM is free software; you can copy, modify, and distribute it  |  
   | under the terms of the GNU Affero General Public License           |  
   | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |  
   |                                                                    |  
   | CiviCRM is distributed in the hope that it will be useful, but     |  
   | WITHOUT ANY WARRANTY; without even the implied warranty of         |  
   | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |  
   | See the GNU Affero General Public License for more details.        |  
   |                                                                    |  
   | You should have received a copy of the GNU Affero General Public   |  
   | License and the CiviCRM Licensing Exception along                  |  
   | with this program; if not, contact CiviCRM LLC                     |  
   | at info[AT]civicrm[DOT]org. If you have questions about the        |  
   | GNU Affero General Public License or the licensing of CiviCRM,     |  
   | see the CiviCRM license FAQ at http://civicrm.org/licensing        |  
   +--------------------------------------------------------------------+  
   /  
    
    
  require_once 'cli.class.php';  
  $cli = new civicrm_Cli();  
  $cli->initialize() || die('Died during initialization');  
  $cli->callApi() || die('Died during callApi');`
  
  **Tags:** permissions, cron-job, cron
  
  > **Comments:**
  > **username_0**: Still spinning my wheels here. Confirmed that CRON is running on the server, and appears to be starting cli.php -- but the script no longer works as expected (due to update?), and because it doesn't complete its task, there's no email sent by the CRON Daemon to tell me what may have gone wrong. So I'm running the scheduled jobs manually every day or two. Inconvenient, but for the time being it works. I've compared the contents of civicrm/civicrm/bin on the server to those on my local system, and they're identical. What else should I try?  
  > **username_3**: I've had issues with cli.php dying for two reasons:  1 - The theme throwing fatal errors. We were using PageLines, which had some issues when bootstrapped like cli.php wants to use it. You could try with a basic WP theme. 2 - make sure that the cron user has a valid entry in the uf_match table  
  > **username_0**: Changed permissions on cli.php and cron.php from 0755 to 0644, and verified the folder containing these scripts was 0755. With permissions set as described, it seems cli.php still does not work unless triggered manually. What next?  
  > **username_0**: Just now saw your reply, username_3 -- thank you for the suggestions. I'll look at uf_match and (if that's not the culprit) I'll see if it works when the theme is running Twenty Seventeen. Soon as I've tried that, I'll report back.  
  > **username_0**: Had to put out some fires, and finally am getting back to this one. Verified the username in both CRON commands matches a valid entry in the civicrm_uf_match table. Still getting "permission denied." Activated Twenty Seventeen theme. Still getting "permission denied." Also, dunno if it's related, but lately when I run scheduled jobs manually, I get a list of subject lines from emails processed through our mail domain. When I click Back, the Civi scheduled jobs screen loads and a success message pops up. Weird. All this to say I still can't get cli.php or cron.php to behave correctly. Ideas?  
  > **username_1**: I get a different error to you: https://civicrm.stackexchange.com/questions/19576/cron-fail-sessions  
  > **username_0**: Good luck with your CRON headache, John. Don't know if yours and mine are related other than the upshot of both is scheduled tasks don't run. This would be easier if I could find some detailed error reporting in the server logs, but the failed CRON jobs don't seem to be documented. Maybe time to turn on debugging ... ?  
  > **username_2**: One reason I use the wp-cli method is that i can call the cron job with flags to tell wp to skip themes '--skip-themes' and I can also add a yml file and not load any plugins except CiviCRM.   This way any errors that a plugin or theme introduces that stops civiCRM are eliminated.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-07-20. Score: 0 | Accepted answer
  
  No idea why PHP cli stopped working. Purists can chastise me for copping out, but I never figured out the PHP cli problem. Instead, I toyed around with wp-cli and ultimately got that working. After testing command lines through SSH, the first glimmer of success came from `wp --user=[REDACTED] --url=https://[REDACTED] --path=/[REDACTED]/ civicrm api job.execute auth=0`
  
  At this point, it was a (relatively) simple matter of discovering the specific path to wp-cli. When that specific path appeared in place of `wp` in the CRON job command line, I received the desired email from the cron daemon indicating the tasks had completed.
  
  So while this may not technically answer my original question, Done is Good, and I'm not going to pursue it further unless and until my CRON jobs again cease running.
  
  > **Comments:**
  > **username_1**: Hi Pronay,  Glad you got it fixed in the end.  Did you log a bug? It might be worth referencing this thread.  If you haven't yet logged a bug, here, let me link it for you: https://issues.civicrm.org/jira/secure/CreateIssue!default.jspa  
  > **username_0**: That success was short-lived. [This new question](https://civicrm.stackexchange.com/questions/19661/another-cron-headache-fwrite-expects-parameter-1-to-be-resource-string-given) describes what happened after a few days of smooth CRON operation via wp-cli.  
  
  ---
  
  ### Answer by username_1 on 2017-07-20. Score: 0
  
  Mine works: Whack this in your crontab -e
  
  00 \* \* \* \* cd /var/www/drupal && /usr/local/bin/drush --quiet civicrm-api -u 1 job.execute
  
  > **Comments:**
  > **username_0**: Thanks John. Will keep that in mind if CRON malfunctions again. Still, I'm skeptical as to whether drush is the way to go within the WordPress environment.  
  
  ---
  
  