• I am attempting to run WP CLI on my server, but I get an error when I try to run it. My server is running on Ubuntu 18.04 and PHP 7.4. When I run WP CLI I get this error:

    PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string
    given in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php:75
    Stack trace:
    #0 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php(75): implode()
    #1 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php(32):
    WP_CLI\DocParser->get_longdesc()
    #2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(113):
    WP_CLI\Dispatcher\CompositeCommand->__construct()
    #3 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(45):
    WP_CLI\Dispatcher\CommandFactory::create_composite_command()
    #4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php(513):
    WP_CLI\Dispatcher\CommandFactory::create()
    #5 phar:///usr/local/bin/wp/vendor/wp-cli/cache-command/cache-command.php(12): WP_CLI::add_command()
    #6 phar:///usr/local/bin/wp/vendor/composer/autoload_real.php(66): require(‘…’)
    #7 phar:///usr/local/bin/wp/vendor/composer/autoload_real.php(56):
    composerRequire6501cc48682cc22d1e9df4be5afc251e()
    #8 phar:///usr/local/bin/wp/vendor/autoload.php(7):
    ComposerAutoloaderInit6501cc48682cc22d1e9df4be5afc251e::getLoader()
    #9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/AutoloaderStep.php(46):
    require(‘…’)
    #10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(74):
    WP_CLI\Bootstrap\AutoloaderStep->process()
    #11 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(23): WP_CLI\bootstrap()
    #12 phar:///usr/local/bin/wp/php/boot-phar.php(11): include(‘…’)
    #13 /usr/local/bin/wp(4): include(‘…’)
    #14 {main}
    thrown in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php on line 75
    root@andre-4:~# cd usr/local/bin/wp/vendor/wp-cli/wp-cli/php/
    -bash: cd: usr/local/bin/wp/vendor/wp-cli/wp-cli/php/: No such file or directory

    I can’t even update it using: wp cli update –allow-root without getting the same error.

    Please help, I use this to update my plugins on my server, and it wont run. I have no idea how to fix this, because I can’t even update it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • When was the last time it was working properly?

    Thread Starter alexDx

    (@alexdx)

    Last week it was working properly, but I did do some server updates last week. Tried running it yesterday, and getting the above error. I’m thinking it might be an older version of WP-CLI, but I can’t even run an update on it without getting that same error.

    Moderator bcworkz

    (@bcworkz)

    It seems there was an incomplete update and at least one required file is missing. Instead of attempting an update, try reinstalling as though it hadn’t existed in the first place.
    https://wp-cli.org/#installing

    Coby Tamayo

    (@acobster)

    This is not an issue with the download, it’s a bug in WP-CLI. The WP-CLI team is working on a fix.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can’t run or update WP CLI due to fatal error’ is closed to new replies.