如何解决mysqli.so,无法打开共享对象文件

如何解决mysqli.so,无法打开共享对象文件
Message:  PHP Startup: Unable to load dynamic library '/path/to/extension/mysqli.so' (tried: /path/to/extension/mysqli.so (/path/to/extension/mysqli.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718//path/to/extension/mysqli.so.so (/usr/lib/php/20170718//path/to/extension/mysqli.so.so: cannot open shared object file: No such file or directory))</p>


<h4>A PHP Error was encountered</h4>

<p>Severity: Core Warning</p>
<p>Message:  PHP Startup: Unable to load dynamic library '/path/to/extension/mysqli.so' (tried: /path/to/extension/mysqli.so (/path/to/extension/mysqli.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718//path/to/extension/mysqli.so.so (/usr/lib/php/20170718//path/to/extension/mysqli.so.so: cannot open shared object file: No such file or directory))</p>
<p>Filename: Unknown</p>
<p>Line Number: 0</p>

find / -name 'mysqli.so'

/usr/lib/php/20190902/mysqli.so
/usr/lib/php/20170718/mysqli.so
/usr/lib/php/20151012/mysqli.so

find / -name 'php.ini'

/etc/php/7.0/cli/php.ini
/etc/php/7.0/apache2/php.ini
/etc/php/7.2/cli/php.ini
/etc/php/7.2/apache2/php.ini
/etc/php/7.4/cli/php.ini
/etc/php/7.4/apache2/php.ini

答案1

您必须重新安装包裹此库取决于你的 Ubuntu 版本:

sudo apt-get install --reinstall php7.0-mysql # for 16.04 LTS
sudo apt-get install --reinstall php7.2-mysql # for 18.04 LTS
sudo apt-get install --reinstall php7.4-mysql # for 20.04 LTS and 20.10

相关内容