If you have root-level access to the server you can follow this guide to install WP CLI on your WHM/cPanel server: https://blog.cpanel.com/wp-cli-install-and-manage-wordpress-on-the-command-line/
If you don’t have access to the root account nor can run sudo, but still have a user/level access to the terminal like from the cPanel terminal let’s say, then you can still install and use wp-cli.
cd /home/USERNAME/public_html/
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
and then use the full path to the wp-cli.phar file:
/home/USERNAME/public_html/wp-cli.phar config list
Where:
- USERNAME – is your cPanel username
- /home/USERNAME/public_html/ – is the path to your WordPress installation
- config list – is an example command for WP-CLI
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂
It worked on a cPanel shared hosting without root nor sudo access, but before “/home/USERNAME/public_html/wp-cli.phar config list” line, it was needed to run “chmod +x wp-cli.phar”. Thanks for sharing WP-CLI knowledge.