Answers.Body: <p>Thanks.</p>
  <p>Just to say this matter is resolved.</p>
  <p>The answer was to put the whole command on one line and remove the several new lines (&quot;&quot;) from the command. The new lines are ignored, this has the effect of other parameters provided being ignored.</p>
  <p>So - In this Example (that didn't work):</p>
  <p>/usr/local/bin/wp --&gt; backslashhereneedsremoving<br />
  --user=redacted --&gt; backslashhereneedsremoving<br />
  --url=https://ourwebsite.uk/members --&gt;backslashhereneedsremoving<br />
  --path=/home/myukm/public_html/members/ --&gt;backslashhereneedsremoving<br />
  civicrm api job.execute auth=0</p>
  <ol>
  <li>Remove the \ slashes that I have highlighted above and the command should become:</li>
  </ol>
  <p>/usr/local/bin/wp --user=redacted --url=https://ourwebsite.uk/members --path=/home/myukm/public_html/members/ civicrm api job.execute auth=0</p>
  <p>(all on one line).</p>
  <p>Goodness knows why I can't make slashes bold here or as soon as I try and highlight them in any way it makes them disappear.</p>
  <p>Where - user= I redacted this but this should be your cron user i.e. --user=timsmith
  The URL - the URL to your WordPress install index.php file as your visitors would use.</p>
  <p>The path - the back end path to the same place - this should be in civicrm.settings.php - as of August 2024 this is located, for WordPress users, at /home/clientusername/public_html/anysubdirectorytowordpressinstallifapplicable/wp-content/uploads/civicrm (don't ask why it's in uploads lol!)</p>
  <p>Within this file, see $civicrm_paths['civicrm.private']['path'] = .....</p>
  <p>Please note - settings vary (I think) between Drupal, Joomla and WordPress but hopefully this should help someone or a Client running WordPress with CiviCRM installed to get their cron jobs/scheduled tasks running using the WP-CLI method.</p>
  <p>Furthermore, you can use the build option in your DA panel admin area to install wp-cli and you will need to for this to work. The resolution detailed in the whole of this post only works for WordPress CiviCRM installs.</p>
  <p>If anyone is running cPanel servers as well - it is apparently worth trying adding  before /usr/local/bin/wp as another member within the CiviCRM community found that the problem for a Client was: &quot;for some odd reason the crontab wasn't immediately invoking php-cli&quot;. I didn't need to do this with DA.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-08-06T17:36:31.240Z
Answers.LastActivityDate: 2024-08-06T17:40:09.947Z
Answers.LastEditDate: 2024-08-06T17:40:09.947Z
Answers.UserDisplayName: onerealbeanie
Body: <p><strong>Summarize the problem</strong></p>
  <p>I can't get CiviCRM scheduled jobs to work with the wp-cli method.</p>
  <p><strong>Systems</strong></p>
  <p>WordPress 6.6.1
  DirectAdmin 1.665 (92be28b19a1bf46189bd72b648cc39ee0792ce51)
  debian12_amd64
  CiviCRM 5.75.1</p>
  <p><strong>Provide details and any research</strong></p>
  <ol>
  <li><p>I've read <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/" rel="nofollow noreferrer">https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/</a> repeatedly</p>
  </li>
  <li><p>I've asked in CiviCRM chat that was dead over the weekend and dead today. Limited conversation with one person in CiviCRM chat that got me to what I tried (below) that still failed.</p>
  </li>
  <li><p>Spoke to DirectAdmin people and managed to get hold of one person who tried his best to help but we got stuck to.</p>
  </li>
  <li><p>Tried to find information on Google - I spotted nothing useful.</p>
  </li>
  <li><p>Raised the issue on the documentation channel in the hope that this can be improved.</p>
  </li>
  <li><p>Searched here before posting.</p>
  </li>
  </ol>
  <p><strong>When appropriate, describe what you’ve tried</strong></p>
  <pre><code>/usr/local/bin/wp \ --user=redacted \ --url=https://ourwebsite.uk/members \ --path=/home/myukm/public_html/members/ \ civicrm api job.execute auth=0
  </code></pre>
  <p>I also tried running this in terminal and got the following error:</p>
  <pre><code>myukm@corinthian:~$ /usr/local/bin/wp \ --user=redacted \ --url=https://ourwebsite.uk/members \ --path=/home/myukm/public_html/members/ \ civicrm api job.execute auth=0
  PHP Warning:  PHP Startup: Unable to load dynamic library 'i360.so' (tried: /usr/local/php82/lib/php/extensions/no-debug-non-zts-20220829/i360.so (libhs_runtime.so.5: cannot open shared object file: No such file or directory), /usr/local/php82/lib/php/extensions/no-debug-non-zts-20220829/i360.so.so (/usr/local/php82/lib/php/extensions/no-debug-non-zts-20220829/i360.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  Warning: No WordPress installation found. If the command ' --user=redacted  --url=https://ourwebsite.uk/members  --path=/home/myukm/public_html/members/  civicrm api job.execute auth=0' is in a plugin or theme, pass --path=`path/to/wordpress`.
  Error: ' --user=redacted' is not a registered wp command. See 'wp help' for available commands.
  </code></pre>
  <p>Thanks very much for your time :-)</p>
  
Tags: <wordpress><scheduled-job>
Title: Scheduled Jobs for CiviCRM and DirectAdmin wp-cli method
ThreadText: # Scheduled Jobs for CiviCRM and DirectAdmin wp-cli method
  
  (Asked by: username_0 on 2024-08-05)
  
  Summarize the problem
  I can't get CiviCRM scheduled jobs to work with the wp-cli method.
  Systems
  WordPress 6.6.1
  DirectAdmin 1.665 (92be28b19a1bf46189bd72b648cc39ee0792ce51)
  debian12_amd64
  CiviCRM 5.75.1
  Provide details and any research
  
  I've read https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/ repeatedly
  
  I've asked in CiviCRM chat that was dead over the weekend and dead today. Limited conversation with one person in CiviCRM chat that got me to what I tried (below) that still failed.
  
  Spoke to DirectAdmin people and managed to get hold of one person who tried his best to help but we got stuck to.
  
  Tried to find information on Google - I spotted nothing useful.
  
  Raised the issue on the documentation channel in the hope that this can be improved.
  
  Searched here before posting.
  
  
  When appropriate, describe what you’ve tried
  /usr/local/bin/wp \ --user=redacted \ --url=https://ourwebsite.uk/members \ --path=/home/myukm/public_html/members/ \ civicrm api job.execute auth=0
  
  I also tried running this in terminal and got the following error:
  myukm@corinthian:~$ /usr/local/bin/wp \ --user=redacted \ --url=https://ourwebsite.uk/members \ --path=/home/myukm/public_html/members/ \ civicrm api job.execute auth=0
  PHP Warning:  PHP Startup: Unable to load dynamic library 'i360.so' (tried: /usr/local/php82/lib/php/extensions/no-debug-non-zts-20220829/i360.so (libhs_runtime.so.5: cannot open shared object file: No such file or directory), /usr/local/php82/lib/php/extensions/no-debug-non-zts-20220829/i360.so.so (/usr/local/php82/lib/php/extensions/no-debug-non-zts-20220829/i360.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
  Warning: No WordPress installation found. If the command ' --user=redacted  --url=https://ourwebsite.uk/members  --path=/home/myukm/public_html/members/  civicrm api job.execute auth=0' is in a plugin or theme, pass --path=`path/to/wordpress`.
  Error: ' --user=redacted' is not a registered wp command. See 'wp help' for available commands.
  
  Thanks very much for your time :-)
  
  **Tags:** wordpress, scheduled-job
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-08-06. Score: 0
  
  Thanks.
  
  Just to say this matter is resolved.
  
  The answer was to put the whole command on one line and remove the several new lines ("") from the command. The new lines are ignored, this has the effect of other parameters provided being ignored.
  
  So - In this Example (that didn't work):
  
  /usr/local/bin/wp --> backslashhereneedsremoving  
  --user=redacted --> backslashhereneedsremoving  
  --url=https://ourwebsite.uk/members -->backslashhereneedsremoving  
  --path=/home/myukm/public\_html/members/ -->backslashhereneedsremoving  
  civicrm api job.execute auth=0
  
  1. Remove the \ slashes that I have highlighted above and the command should become:
  
  /usr/local/bin/wp --user=redacted --url=https://ourwebsite.uk/members --path=/home/myukm/public\_html/members/ civicrm api job.execute auth=0
  
  (all on one line).
  
  Goodness knows why I can't make slashes bold here or as soon as I try and highlight them in any way it makes them disappear.
  
  Where - user= I redacted this but this should be your cron user i.e. --user=timsmith
  The URL - the URL to your WordPress install index.php file as your visitors would use.
  
  The path - the back end path to the same place - this should be in civicrm.settings.php - as of August 2024 this is located, for WordPress users, at /home/clientusername/public\_html/anysubdirectorytowordpressinstallifapplicable/wp-content/uploads/civicrm (don't ask why it's in uploads lol!)
  
  Within this file, see $civicrm\_paths['civicrm.private']['path'] = .....
  
  Please note - settings vary (I think) between Drupal, Joomla and WordPress but hopefully this should help someone or a Client running WordPress with CiviCRM installed to get their cron jobs/scheduled tasks running using the WP-CLI method.
  
  Furthermore, you can use the build option in your DA panel admin area to install wp-cli and you will need to for this to work. The resolution detailed in the whole of this post only works for WordPress CiviCRM installs.
  
  If anyone is running cPanel servers as well - it is apparently worth trying adding before /usr/local/bin/wp as another member within the CiviCRM community found that the problem for a Client was: "for some odd reason the crontab wasn't immediately invoking php-cli". I didn't need to do this with DA.
  
  
  ---
  
  