WordPress Maintenance

When WP-CLI fatals on the plugin you came to rescue

A WordPress plugin update breaks the site. You SSH in to roll back the bad plugin with WP-CLI, and you get this: Fatal error: Uncaught Error: … in /path/to/broken-plugin/main.php:42 The plugin you came to fix has now stopped the tool you came to fix it with. It looks contradictory, but it makes sense once you know how WP-CLI starts up — and there’s a flag pair that gets you out. Why WP-CLI itself crashes When you run a rollback command like wp plugin install <name> –version=X –force, WP-CLI internally boots WordPress before doing anything else. Plugin registration and option loading all happen during WordPress’s startup, so a broken plugin gets …

Read more
WordPress Maintenance

‘Command not found’ — and what’s really blocking WP-CLI

“I downloaded wp-cli.phar, uploaded it to ~/bin/wp, SSH’d in, and ran wp. Got -bash: wp: command not found. The file is right there. Why?” If you’ve set up WP-CLI on a shared host using a browser-based file manager, you may have hit exactly this. The file exists, permissions are 755, size is 6.8 MB (matches the official PHAR). And yet it refuses to run. The “command not found” message can hide an entirely different problem underneath. The file is there, but nothing runs After SSHing in, you can confirm the file exists: $ ls -la ~/bin/wp -rwxr-xr-x 1 c1234567 c1234567 7142777 May 8 10:00 /home/c1234567/bin/wp $ wp –info -bash: wp: …

Read more