Skip to main content

WP CLI Cron

Comments

3 comments

  • cPRex Jurassic Moderator
    Hey there! You mention /usr/bin/local/wp - is that the renamed wp-cli.phar file? If so, I would expect that to work properly as users should all be able to read that path on the system. More details on that process can be found here: WP CLI: Install and Manage WordPress" on the Command Line | cPanel Blog
    0
  • Arashi Interactive
    Hi there, Yes, following the instructions from here: Command line interface for WordPress | WP-CLI From the command line (either through Terminal in WHM or PuTTY) all users can use the wp cli command. It's only when trying to use that in a cPanel Cron that I get errors saying that wp cannot be found. As I've been searching for a solution for about a week now to no avail, I finally used a secondary server I have to setup a cron that uses SSH to log into WHM/cPanel as the user, run the needed wp cli commands, then log out. I do find it odd that this can't be done via the built in cPanel cron manager. I'm able to run php scripts in cron fine by prepending the file/command with /usr/local/bin/php - so why wouldn't it also work using /usr/local/bin/wp? I'd assume the path would be setup so that all users can run commands found within /usr/local/bin.
    0
  • cPRex Jurassic Moderator
    Can you try this? This seems like a similar situation to what you're seeing:
    0

Please sign in to leave a comment.