Answers.Body: <p>Seems a bit strange to me that you've got WP-CLI installed in the CiviCRM plugin directory. I'd suggest moving it somewhere outside your <code>public_html</code> directory.</p>
  <p>When you've done that and got it working, try this for cron:</p>
  <pre><code>wp --user=MyName --url=https://mywebsite.org --path=/home/customer/www/mywebsite.org/public_html civicrm api job.execute auth=0
  </code></pre>
  <p>The <code>--path</code> is the path to the WordPress directory rather than the path to the CiviCRM plugin directory. Plus I think you have something other than <code>--path</code> there.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-19T09:19:27.197Z
Answers.LastActivityDate: 2022-10-19T09:19:27.197Z
Answers.UserDisplayName: Christian Wach
Body: <p>I’m trying to get cron going using wp-cli</p>
  <p>WordPress: 6.0.3
  civiCRM: 5.52.0
  PHP: 7.4.32</p>
  <p>I think I found the path to wp-cli.</p>
  <p>$ wp —info yields:
  WP_CLI phar path:   /home/customer/www/mywebsite.org/public_html/wp-content/plugins/civicrm</p>
  <p>But executing wp throws a syntax error at the path:</p>
  <p>$ wp --user=MyName --url=https://mywebsite.org —-path=home/customer/www/mywebsite.org/public_html/wp-content/plugins/civicrm api job.execute auth=0</p>
  <p>Error: '—-path=home/customer/www/mywebsite.org/public_html/wp-content/plugins/civicrm' is not a registered wp command. See 'wp help' for available commands.</p>
  <p>What am I doing wrong?</p>
  
Tags: <wordpress><cron>
Title: Cannot get cron going in WordPress using wp-cli
ThreadText: # Cannot get cron going in WordPress using wp-cli
  
  (Asked by: username_0 on 2022-10-19)
  
  I’m trying to get cron going using wp-cli
  
  WordPress: 6.0.3
  civiCRM: 5.52.0
  PHP: 7.4.32
  
  I think I found the path to wp-cli.
  
  $ wp —info yields:
  WP\_CLI phar path: /home/customer/www/mywebsite.org/public\_html/wp-content/plugins/civicrm
  
  But executing wp throws a syntax error at the path:
  
  $ wp --user=MyName --url=https://mywebsite.org —-path=home/customer/www/mywebsite.org/public\_html/wp-content/plugins/civicrm api job.execute auth=0
  
  Error: '—-path=home/customer/www/mywebsite.org/public\_html/wp-content/plugins/civicrm' is not a registered wp command. See 'wp help' for available commands.
  
  What am I doing wrong?
  
  **Tags:** wordpress, cron
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-10-19. Score: 1
  
  Seems a bit strange to me that you've got WP-CLI installed in the CiviCRM plugin directory. I'd suggest moving it somewhere outside your public_html directory.
  When you've done that and got it working, try this for cron:
  wp --user=MyName --url=https://mywebsite.org --path=/home/customer/www/mywebsite.org/public_html civicrm api job.execute auth=0
  
  The --path is the path to the WordPress directory rather than the path to the CiviCRM plugin directory. Plus I think you have something other than --path there.
  
  
  ---
  
  