WorkinOnIt

Well-Known Member
Aug 3, 2016
312
54
78
UK
cPanel Access Level
Root Administrator
I've installed WP CLI via root. User account has jail shell access. In the console, I can execute WO CLI fine. But when trying to set up a crontab within the user's cpanel - to execute a command from a plugin on a WP CLI site - I get following errors;




0,30****/usr/local/bin/wp --path=/home/accountusername/test.example.com/ import increment specials

Status: 500 Internal Server Error

So then I realised I need to run it like the below -


0,30****/usr/local/bin/php /usr/local/bin/wp --path=/home/accountusername/test.example.com/ import increment specials

but the result: Error: Invalid value specified for positional arg.




Any help appreciated.

I did look at these, but they have not helped:
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
Hey there! If you access SSH as that particular cPanel user and run "wp --info" does that return the normal information? Here is what I see when I run that command as a cPanel user on my personal server:

Code:
[username@host ~]$ wp --info
OS:    Linux 4.18.0-348.12.2.el8_5.x86_64 #1 SMP Wed Jan 19 14:35:04 EST 2022 x86_64
Shell:    /bin/bash
PHP binary:    /opt/cpanel/ea-php80/root/usr/bin/php
PHP version:    8.0.20
php.ini used:    /opt/cpanel/ea-php80/root/etc/php.ini
MySQL binary:    /usr/bin/mysql
MySQL version:    mysql  Ver 8.0.29 for Linux on x86_64 (MySQL Community Server - GPL)
SQL modes:  
WP-CLI root dir:    phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:    phar://wp-cli.phar/vendor
WP_CLI phar path:    /home/username
WP-CLI packages dir:  
WP-CLI global config:  
WP-CLI project config:  
WP-CLI version:    2.6.0
If not, it would be worth running "echo $PATH" to ensure that /usr/local/bin is included in the user's PATH, since that is the default location of the wp tool according to their installation guide here: