0

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?

1 Answer 1

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.

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.