- Plesk 12.5 for Linux
- Plesk Onyx for Linux
WordPress instance is marked as broken. An error, similar to below is showing at Plesk > WordPress > /httpdocs (broken instance):
PLESK_ERROR: Parse error: syntax error, unexpected '$g0033c4' (T_VARIABLE) in /var/www/vhosts/example.com/httpdocs/wp-includes/rest-api/endpoints/class-wp-rest-controller.php on line 1
PLESK_ERROR: Fatal error: Class 'WP_REST_Controller' not found in /var/www/vhosts/sentryinspecting.com/httpdocs/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php on line 17
A part of WordPress installation is corrupted.
Connect to the server via SSH;
- Create any additional directory, for example:
# mkdir /root/wordpress_clean
Download the same WordPress release from https://wordpress.org/download/release-archive/, to the server. For example,
# cd /root/wordpress_clean
# wget https://wordpress.org/wordpress-4.9.tar.gz
- Unpack the archive:
# tar -zxf /root/wordpress-4.9.tar.gz
- Replace the damaged file from the error with the same one from unpacked archieve:
# cp /root/wordpress_clean/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-controller.php /var/www/vhosts/example.com/httpdocs/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
cp: overwrite '/var/www/vhosts/example.com/httpdocs/wp-includes/rest-api/endpoints/class-wp-rest-controller.php'? y
- Go to Plesk > WordPress > /httpdocs (broken instance) and click Refresh;
- In case the issue remains with pointing to another file, replace it too.
The issue could be caused by malicious scripts uploaded via WordPress. In order to prevent it, consider securing the WordPress instance via WordPress Toolkit.