Articles in this section

WordPress installation or Cloning fails in Plesk: Unable to load dynamic library 'mysqli.so'

kb: technical ext: wptk

Applicable to:

  • Plesk Obsidian for Linux

Symptoms

  • Wordpress Cloning or installation fails when the (target) domain uses alt-php from CloudLinux: 

    CONFIG_TEXT: PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /opt/alt/php82/usr/lib64/php/modules/mysqli.so (/opt/alt/php82/usr/lib64/php/modules/mysqli.so: cannot open shared object file: No such file or directory), /opt/alt/php82/usr/lib64/php/modules/mysqli.so.so (/opt/alt/php82/usr/lib64/php/modules/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
    Error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
    Please check that the mysqli PHP extension is installed and enabled.
    If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums. Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Cause

The error is caused by the WP-Toolkit extension bug #EXTWPTOOLK-10849. Plesk supports the PLESK_TRY_CAGEFS environment variable to properly load all configuration files, but WP-Toolkit do not pass it while calling the wp-cli commands.

Resolution

The Bug will be fixed in one of future Plesk updates and the bug number will be published to changelogs once it is fixed. In the meanwhile, following 2 workarounds can be applied to fix the errors:

Via Plesk interface(Preferable)
  1. Log in to Plesk
  2. Go to CloudLinux Manager>Selector 
  3. Select the default Modules for affected PHP version:
  4. Make sure that mbstring, json and mysqli modules are enabled and nd_mysqli is disabled:
  5. Hit Save
Via command-line-interface
  1. Connect to the server via SSH
  2. Edit the /opt/alt/phpXX/link/conf/default.ini file:

    Where phpXX is the 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 and nd_mysqli.so is disabled:

    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

  3. Save the Settings

     

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.