admin管理员组

文章数量:1131184

I'm trying to run 'wp --search-replace' within a vhost webroot on an apache host.

The operation returns:

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.

However, this host has mariadb installed and running. And PHP can connect to it.

I have another vhost running a WordPress site on the same host. The other site is functioning perfectly and has no trouble connecting to mysql.

Why is wp-cli failing to connect to the database?

I'm trying to run 'wp --search-replace' within a vhost webroot on an apache host.

The operation returns:

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.

However, this host has mariadb installed and running. And PHP can connect to it.

I have another vhost running a WordPress site on the same host. The other site is functioning perfectly and has no trouble connecting to mysql.

Why is wp-cli failing to connect to the database?

Share Improve this question asked Dec 5, 2023 at 6:28 bobbob 2491 gold badge6 silver badges16 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

There was nothing wrong with the host configuration.

The php version being used by the shell was different from the php version that the webserver passes requests to.

The problem was solved by installing a mysql extension for the php version that the shell runs.

本文标签: wp cliwpcli searchreplace fails reports that mysqli needs to be installed