Symptoms
-
The following error is shown when opening a WordPress instance at WordPress > example.com page:
PHP Parse error: syntax error, unexpected '?' in /usr/share/plesk-wp-cli/php/WP_CLI/Runner.php(996): eval()'d code on line 1
-
Symbols like
<U+FEEF>can be observed in the beginning of thewp-config.phpfile over command-line interface usinglesstool:# less /var/www/vhosts/example.com/httpdocs/wp-config.php
<U+FEFF><?php
...
Cause
Hidden incorrect symbols in wp-config.php file.
Resolution
-
Log in to the server via SSH.
-
Rename the current
wp-config.phpfile.# mv /var/www/vhosts/example.com/httpdocs/wp-config.php{,.orig}
-
Create a new one by copying the content from the renamed file using
cattool:# cat /var/www/vhosts/example.com/httpdocs/wp-config.php.orig > /var/www/vhosts/example.com/httpdocs/wp-config.php
Note: replace example.com with the actual domain's name in the commands above.