Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
WordPress instance is marked as broken in Plesk:
PLESK_WARN: Broken instance on 'example.com' in '/httpdocs'
-
Attempt to Refresh or Clone the instance leads to the next error message:
PLESK_ERROR: PHP Fatal error: Uncaught TypeError: Argument 1 passed to WP_CLI\\Runner::WP_CLI\\{closure}() must be an instance of Exception, instance of ParseError given in /opt/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1470\nStack trace:\n
#0 [internal function]: WP_CLI\\Runner-\x3EWP_CLI\\{closure}(Object(ParseError))\n
#1 {main}\n thrown in /opt/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php on line 1470\n
{"err_code":0,"err_message":"Failed to parse wp-config.php: Uncaught TypeError: Argument 1 passed to WP_CLI\\\\Runner::WP_CLI\\\\{closure}() must be an instance of Exception, instance of ParseError given in \\/opt\\/psa\\/admin\\/plib\\/modules\\/wp-toolkit\\/vendor\\/wp-cli\\/wp-cli\\/php\\/WP_CLI\\/Runner.php:1470\\nStack trace:\\n -
There is a Byte-Order Mark character in
wp-config.php
:
# less /var/www/vhosts/example.com/httpdocs/wp-config.php
<EF><BB><BF><?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
[...] -
The same happens if BOM character may present in
wp-includes/functions.php
andindex.php
. -
Error like the following can be found in accessing the WordPress instance in Plesk > WordPress > example.com > Log in:
CONFIG_TEXT: Failed to parse wp-config.php: Uncaught TypeError: Argument 1 passed to WP_CLI\Runner::WP_CLI\{closure}() must be an instance of Exception, instance of ParseError given in C:\Program Files (x86)\Plesk\Additional\modules\wp-toolkit\wp-cli\wp-cli\php\WP_CLI\Runner.php:1682
Stack trace:
#0 [internal function]: WP_CLI\Runner->WP_CLI\{closure}(Object(ParseError))
#1 {main} thrown on line 1682 - The following notifications may be received:
CONFIG_TEXT: Website "/httpdocs" (example.com): Failed to reset cache for the instance #2
Cause
BOM (Byte-Order Mark) character doesn't allow WordPress toolkit to operate properly.
Resolution
Note: This article may require additional administrative knowledge to apply. If any help required, contact server’s administrator or hosting support.
-
Go to Domains > example.com > File Manager and open
wp-config.php
orwp-includes/functions.php
file. -
Remove BOM character from the file and save the changes. BOM character should look like a dot (refer to the image above).
-
Refresh the instance via Domains > example.com > WordPress > Broken instance > Refresh.
Click on a section to expand
- Connect to the server via SSH
- Get the list of the configuration files:
# find /var/www/vhosts/* -name wp-config.php > /root/configs.txt
Note: Review /root/configs.txt file in any text editor and exclude configuration files for specific domains if it is required.
- Create backup of wp-config files:
# cat /root/configs.txt | while read i; do cp -p $i $i.`date +%Y.%m.%d.%H.%M.%S`; done
- Clear BOM symbols:
# cat /root/configs.txt | while read i; do sed -i '1 s/^\xef\xbb\xbf//' $i; done
Comments
0 comments
Please sign in to leave a comment.