• Hello, I’m trying to start wp-cli, I’ve already followed the entire installation tutorial on the official website [https://wp-cli.org/br/] however, it is not recognizing the wp command, it returns: -bash: wp: command not found.
    When I give the command php wp-cli.phar –info it returns normally.

    I already gave the commands chmod +x wp-cli.phar and sudo mv wp-cli.phar /usr/local/bin/wp

    Can anyone help me? I can’t figure it out.
    Thank you very much!

    Output of commands:

    echo $PATH :
    /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

    php wp-cli.phar –info:
    OS: Linux 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64
    Shell: /bin/bash
    PHP binary: /usr/bin/php7.4
    PHP version: 7.4.33
    php.ini used: /etc/php/7.4/cli/php.ini
    MySQL binary: /usr/bin/mysql
    MySQL version: mysql Ver 15.1 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper
    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: /usr/local/bin
    WP-CLI packages dir:
    WP-CLI cache dir: /home/natcorsi/.wp-cli/cache
    WP-CLI global config:
    WP-CLI project config:
    WP-CLI version: 2.7.1`

    • This topic was modified 2 years, 3 months ago by Nathan Corsi.
    • This topic was modified 2 years, 3 months ago by Nathan Corsi.
Viewing 2 replies - 1 through 2 (of 2 total)
  • And when you type which wp ?

    If wp-cli.phar --info works, I’d assume your move command didn’t execute as expected.
    What does ls -l /usr/local/bin/wp output?

    Also, for the record, I’m more partial to getting the file like this:
    curl --output wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘-bash: wp: command not found’ is closed to new replies.