↑ ↓ select, Enter open, Esc close

Show the WP-CLI version and the PHP it uses

user@server
wp --info

Shows which PHP binary and which php.ini WP-CLI runs with, plus the WP-CLI version and the paths to the global and project config. On Plesk servers, the command line often uses a different PHP version than the website. That explains errors that only occur in WP-CLI.

Note: Force a specific Plesk PHP version with /opt/plesk/php/8.3/bin/php /usr/local/bin/wp, provided WP-CLI is installed there. Update with wp cli update (Phar installation, requires root).

Also searched as

  • which php version does wp cli use
  • check wp cli version
  • wp cli wrong php version

Related one-liners

All in WP-CLI

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.