Applicable to:
- Plesk for Linux
Symptoms
-
Plesk is installed on a CloudLinux server.
-
When installing WordPress via WP Toolkit, the operation fails with the following error message:
PLESK_ERROR: PHP Fatal error: Uncaught Error: Call to undefined function json_encode() in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/vendor/mustache/mustache/src/Mustache/Engine.php:637
-
When scanning or refreshing a WordPress instance in WP Toolkit, one of the following happens:
-
the operation completes with the following error message and the instance is marked as broken:
PLESK_ERROR: Your PHP installation appears to be missing the MySQL extension which is required by WordPress. PHP Fatal error: Uncaught Error: Call to undefined function json_encode() in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/php/class-wp-cli.php:742
-
the instance is marked as broken and the following error message appears in
/var/log/plesk/panel.log
:CONFIG_TEXT: ERR [extension/wp-toolkit] Failed to reset cache for the instance #X, reason: Error establishing a database connection.
-
Cause
This was reported as a WP Toolkit bug with ID EXTWPTOOLK-4371 and in the scope of PPP-52061 (Plesk 18.0.36) default configuration of Alt-PHP was adjusted to comply with Plesk needs.
PHP extensions like json.so and mysqli.so for Alt-PHP are disabled.
Resolution
Apply one of the following workarounds:
-
Connect to the Plesk server via SSH.
-
Create a symbolic link:
# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
-
Go to Domains > example.com > PHP Settings.
-
Add the following lines to the Additional configuration directives field:
CONFIG_TEXT: extension=json.so
extension=mysqli.so
extension=pdo_mysql.soNote: If the error "Module 'mysqli' already loaded at Unknown#0" is shown when accessing domains, disable the above extensions at Domains > example.com > PHP Selector.
-
Go to Domains > example.com > PHP Settings.
-
Change PHP handler to any non Alt-PHP.
-
Go to Domains > example.com > WordPress.
-
On the affected WordPress instance, click > Detach.
-
Click Scan to detect the instance.
Comments
0 comments
Please sign in to leave a comment.