Applicable to:
- Plesk for Linux
Symptoms
-
CloudLinux 7.x with LVE Manager and CageFS support is used
-
alt-php is enabled on the affected domain
-
When trying to install WordPress via the tab Domains > example.com > WordPress > Install, one of the following errors is shown:
PHP Fatal error: Uncaught Error: Call to undefined function json_encode() in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/mustache/mustache/src/Mustache/Engine.php:637
Fatal error: Call to undefined function mysqli_connect() in /usr/local/psa/var/apspackages/c74e7822-0a26-42e8-9ea6-0c57a5edd8a9/cache/scripts/db-util.php on line 53
Error establishing a database connection. This either means that the username and password information in your `wp-config.php` file is incorrect or we can’t contact the database server at `localhost:3306`. This could mean your host’s database server is down.
Alternative error message with json decode
PHP Fatal error: Uncaught Error: Call to undefined function json_decode() in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/mustache/mustache/src/Mustache/Engine.php:637
-
There following error appears in Plesk:
PLESK_ERROR: Unable to interact with the newly created WordPress instance. It may have become corrupted.
-
Cloning a WordPress instance fails with the following error message:
PLESK_ERROR: Task is not responding: id=1331, pid=258404, type=ext-wp-toolkit-task\manage
-
There are the following records in
/var/log/plesk/panel.log
file:CONFIG_TEXT: DEBUG [util_exec] [1137da7ae7e29729c434a89b417517e6-0] Finished in 0.24553s, Error code: 0, stdout: Your PHP installation appears to be missing the MySQL extension which is required by WordPress., stderr:
Cause
This is Plesk bug with ID PPPM-7237, which is planned to be fixed in next product updates.
Resolution
As a workaround do the following:
Click on a section to expand
- Go to Tools & Settings > PHP Settings > alt-phpXX
Where phpXX is version of PHP set up in for the affected domain under Plesk > Domains > example.com > PHP Selector. -
Enable the following extensions:
- mbstring
- mysqli
- json
- propro
- raphf
- Click OK.
Click on a section to expand
Note: If direct SSH access to the server is not possible, contact the server administrator for further assistance.
-
Connect to the server via SSH
-
Edit the
/opt/alt/phpXX/etc/php.d/default.ini
file:Where phpXX is version of PHP set up in for the affected domain under Plesk > Domains > example.com > PHP Selector.
Make sure that mbstring, json and mysqli modules are enabled.extension=mbstring.so <---- Uncomment this line
;extension=bcmath.so
;extension=dom.so
extension=json.so <---- Uncomment this line
;extension=gd.so
;extension=posix.so
;extension=sockets.so
;extension=xmlreader.so
;extension=xmlwriter.so
;extension=zip.so
;extension=fileinfo.so
;extension=nd_mysqli.so <---- Comment this line
extension=mysqli.so <---- Add a new line
Comments
10 comments
Need to ensure cagefs is updated / restart your alt-php service or you may experience a post install issue of WordPress saying the mysql extension is missing
Example:
cagefsctl --force-update-etc
cagefsctl --force-update
cagefsctl --rebuild-alt-php-ini
service alt-php71-fpm restart
You dont need to log in to ssh, you can go to Tools & Settings > PHP Settings and enable mbstring, json and mysqli there :)
Hello @Lars-Erik,
Thank you for notice.
This article's author will review it soon.
Do you have some resolution for CloudLinux 6?
@Boss
We have yet to encounter this issue on CloudLinux 6, but the same logic must apply - enable required PHP extensions.
If the issue still persists, provide us with the new error message from '/var/log/plesk/panel.log'.
Hi,
i have this:
CloudLinux 7.x with LVE Manager and CageFS support is used
alt-php is enabled on the affected domain
and after moving to other Server via migrator all WP Instances are not Working anymore with WP Toolkit.
No Chance... I tried your Support Articles. Whats wrong here?
stderr:
Fehler beim Aufbau einer Datenbankverbindung.
{"err_code":true,"err_message":"Fehler beim Aufbau einer Datenbankverbindung."}
[2019-07-22 17:52:11.023] ERR [extension/wp-toolkit] An error occurred while executing WP-CLI command for instance: WordPress instance #7 ('')
[2019-07-22 17:52:11.442] ERR [extension/wp-toolkit] Failed to generate screenshot of instance #7: URL of instance #7 is empty
@Lenor
Try the following article as well:
https://support.plesk.com/hc/en-us/articles/115002062349-After-removing-a-WordPress-domain-WordPress-Toolkit-starts-to-show-error-Can-not-find-domain-by-id-
If it does not help, please submit a request to support as per https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-
Cloudlinux Support sais its a bug with you as your toolkit is not using right PHP Instance....
I can't open Ticket, as i am not registered with you directly.. .
Hi Lenor,
The error provided is not enough to understand the cause of the issue: we need to investigate it deeper. If it is not possible to submit request, you either can contact your Hosting Provider or purchase support subscription and then contact support team:
https://support.plesk.com/hc/en-us/articles/213953025-How-to-get-support-directly-from-Plesk-
the problem persists
Please sign in to leave a comment.