我正在设置一个网络服务器,使用 Debian 10、Apache2、PHP7.3、MariaDB 和 PHPMyAdmin。
当我启动 Apache2 时它会说:
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20180731/mysqli (/usr/lib/php/20180731/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mysqli.so (/usr/lib/php/20180731/mysqli.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/etc/php/7.3/mods-available/mysqli.ini' (tried: /etc/php/7.3/mods-available/mysqli.ini (/etc/php/7.3/mods-available/mysqli.ini: invalid ELF header), /usr/lib/php/20180731//etc/php/7.3/mods-available/mysqli.ini.so (/usr/lib/php/20180731//etc/php/7.3/mods-available/mysqli.ini.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20180731/mysqli (/usr/lib/php/20180731/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mysqli.so (/usr/lib/php/20180731/mysqli.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20180731/pdo_mysql (/usr/lib/php/20180731/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_mysql.so (/usr/lib/php/20180731/pdo_mysql.so: undefined symbol: mysqlnd_allocator)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/lib/php/20180731/mysqli.so (/usr/lib/php/20180731/mysqli.so: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mysqli.so.so (/usr/lib/php/20180731/mysqli.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Apache2 可以正常启动,但我想使用它,因此我需要修复它。尝试在 php.ini 中启用它,当我禁用它时,错误仍然存在。每次调整后我都会重新启动 Apache2。
编辑:重新安装 MySQL,MySQLi 工作正常。新错误:
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20180731/mysqli (/usr/lib/php/20180731/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mysqli.so (/usr/lib/php/20180731/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/etc/php/7.3/mods-available/mysqli.ini' (tried: /etc/php/7.3/mods-available/mysqli.ini (/etc/php/7.3/mods-available/mysqli.ini: invalid ELF header), /usr/lib/php/20180731//etc/php/7.3/mods-available/mysqli.ini.so (/usr/lib/php/20180731//etc/php/7.3/mods-available/mysqli.ini.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20180731/mysqli (/usr/lib/php/20180731/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/mysqli.so (/usr/lib/php/20180731/mysqli.so: undefined symbol: mysqlnd_global_stats)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20180731/pdo_mysql (/usr/lib/php/20180731/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20180731/pdo_mysql.so (/usr/lib/php/20180731/pdo_mysql.so: undefined symbol: mysqlnd_allocator)) in Unknown on line 0
mysqli.so 位于正确的位置,但文件中出错了。该文件是编译后的代码,因此更改内容实际上不是一个选择。有人能很好地修复这个问题吗?还是需要重新安装?