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.php
file over command-line interface usingless
tool:# 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.php
file.# mv /var/www/vhosts/example.com/httpdocs/wp-config.php{,.orig}
-
Create a new one by copying the content from the renamed file using
cat
tool:# 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.