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:
- Log in to Plesk.
- Go to CloudLinux Manager>Selector
- Select the default Modules for affected PHP version:
- Make sure that mbstring, json and mysqli modules are enabled and nd_mysqli is disabled:
- Hit Save
- Connect to the server via SSH
-
Edit the
/opt/alt/phpXX/link/conf/default.inifile: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 -
Save the Settings
Comments
Please sign in to leave a comment.