最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp search-replace on database returns PHP fatal error: Array and string offset access syntax with curly braces is no longer supp

programmeradmin2浏览0评论

So I need to setup a client website locally for improvements. I'm trying to search and replace any instances of the live site's name/url and replace it with a development one.

When I run the command:

wp search-replace 'livesite' 'local.lvh.me' --all-tables --precise --verbose

I get the following error:

PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /path_to_project/wp-content/plugins/gravityforms/common.php on line 4181
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/wp:0
PHP   2. include() /usr/local/bin/wp:4
PHP   3. include() phar:///usr/local/bin/wp/php/boot-phar.php:11
PHP   4. WP_CLI\bootstrap() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php:27
PHP   5. WP_CLI\Bootstrap\LaunchRunner->process($state = class WP_CLI\Bootstrap\BootstrapState { private $state = [] }) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php:74
PHP   6. WP_CLI\Runner->start() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:23
PHP   7. WP_CLI\Runner->load_wordpress() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1158
PHP   8. require() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1237
PHP   9. include_once() /path_to_project/wp-settings.php:371
Error: There has been a critical error on your website.Learn more about debugging in WordPress. There has been a critical error on your website.

I get that as the error says, curly braces are deprecated and need to be replaces with square braces. If I go to the file specified and change them over the search and replace progresses until it runs into the issue again. Obviously manually changing every occurrence of this error isn't really an option however as it would take days.

Is there a fix to this that I haven't spotted?

Any help would be greatly appreciated as this has been on the desk for awhile!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论