• Resolved strarsis

    (@strarsis)


    When using the WP CLI, redirection causes an exception:

    `
    Fatal error: Uncaught Error: Class "WP_CLI" not found in /srv/www/web/app/plugins/redirection/redirection-cli.php:282
    Stack trace:
    #0 /srv/www/web/app/plugins/redirection/redirection.php(94): require_once()
    #1 /srv/www/web/wp/wp-settings.php(377): include_once('/srv/www/web/ap...')
    #2 phar:///bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1237): require('/srv/www/web/wp...')
    #3 phar:///bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1158): WP_CLI\Runner->load_wordpress()
    #4 phar:///bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
    #5 phar:///bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/bootstrap.php(74): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
    #6 phar:///bin/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
    #7 phar:///bin/wp-cli.phar/php/boot-phar.php(11): include('phar:///bin/wp-...')
    #8 /bin/wp-cli.phar(4): include('phar:///bin/wp-...')
    #9 {main}
      thrown in /srv/www/web/app/plugins/redirection/redirection-cli.php on line 282
    

    `

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author John Godley

    (@johnny5)

    Thanks. I’ll look at PHP 8 soon.

    I just rant into these today, this is search-replace command:

    
    PHP Fatal error:  Uncaught TypeError: unserialize(): Argument #1 ($data) must be of type string, array given in phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php:86
    Stack trace:
    #0 phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(86): unserialize(Array)
    #1 phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(88): WP_CLI\SearchReplacer->run_recursively(Array, true, 1)
    #2 phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(57): WP_CLI\SearchReplacer->run_recursively('a:23:{s:32:"2cc...', false)
    #3 phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(554): WP_CLI\SearchReplacer->run('a:23:{s:32:"2cc...')
    #4 phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(390): Search_Replace_Command->php_handle_col('option_value', Array, 'wp_options', 'https://satdev....', 'http://localhos...')
    #5 [internal function]: Search_Replace_Command->__invoke(Array, Array)
    #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func(Array, Array, Array)
    #7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
    #8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(451): call_user_func(Object(Closure), Array, Array)
    #9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(371): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
    #10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(394): WP_CLI\Runner->run_command(Array, Array)
    #11 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1160): WP_CLI\Runner->run_command_and_exit()
    #12 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
    #13 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(74): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
    #14 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
    #15 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('phar:///usr/loc...')
    #16 /usr/local/bin/wp(4): include('phar:///usr/loc...')
    #17 {main}
      thrown in phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php on line 86
    Error: There has been a critical error on this website.Learn more about debugging in WordPress. There has been a critical error on this website.
    
    Plugin Author John Godley

    (@johnny5)

    @anithegregorian you don’t appear to be using Search Regex

    This is what I’ve been using with PHP 7.4 and WP-CLI 2.4.0:

    wp search-replace 'https://satdev.kinsta.com' 'https://localhost/satdev'

    These errors started showing up after upgrading to PHP 8. Haven’t used regex before, this command use to work.

    Should I format the command in a different way? Thx

    Plugin Author John Godley

    (@johnny5)

    @anithegregorian this forum is for Redirection. You are using something else. You should ask the question in the appropriate forum.

    • This reply was modified 3 years, 3 months ago by John Godley.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP 8 incompatibilities’ is closed to new replies.