gpt4 book ai didi

php - PHP5中的错误..无法加载动态库

转载 作者:IT老高 更新时间:2023-10-28 11:56:53 25 4
gpt4 key购买 nike

root@ip-10-131-9-200:/etc/php5/apache2# php -a
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/curl.so' - /usr/lib/php5/20090626+lfs/curl.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 '/usr/lib/php5/20090626+lfs/mcrypt.so' - /usr/lib/php5/20090626+lfs/mcrypt.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 '/usr/lib/php5/20090626+lfs/mysql.so' - /usr/lib/php5/20090626+lfs/mysql.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 '/usr/lib/php5/20090626+lfs/mysqli.so' - /usr/lib/php5/20090626+lfs/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 '/usr/lib/php5/20090626+lfs/pdo.so' - /usr/lib/php5/20090626+lfs/pdo.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 '/usr/lib/php5/20090626+lfs/pdo_mysql.so' - /usr/lib/php5/20090626+lfs/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
Interactive shell

最佳答案

尽管有其他几个答案建议这样做,但安装更多不必要的软件通常不是最好的解决方案。相反,您应该解决根本问题。出现这些消息的原因是您尝试加载这些扩展,但未安装它们。所以简单的解决方案就是告诉 PHP 停止尝试加载它们:

首先,找出哪些文件正在尝试加载上述扩展:

$ grep -Hrv ";" /etc/php5 | grep -E "extension(\s+)?="

Ubuntu 的示例输出:

/etc/php5/mods-available/gd.ini:extension=gd.so
/etc/php5/mods-available/pdo_sqlite.ini:extension=pdo_sqlite.so
/etc/php5/mods-available/pdo.ini:extension=pdo.so
/etc/php5/mods-available/pdo_mysql.ini:extension=pdo_mysql.so
/etc/php5/mods-available/mysqli.ini:extension=mysqli.so
/etc/php5/mods-available/mysql.ini:extension=mysql.so
/etc/php5/mods-available/curl.ini:extension=curl.so
/etc/php5/mods-available/sqlite3.ini:extension=sqlite3.so
/etc/php5/conf.d/mcrypt.ini:extension=mcrypt.so
/etc/php5/conf.d/imagick.ini:extension=imagick.so
/etc/php5/apache2/php.ini:extension=http.so

现在只需找到正在加载导致错误的扩展的文件并使用 ; 注释掉这些行。由于某种原因,默认安装的 Ubuntu 发生在我身上,所以希望这对其他人有帮助。

关于php - PHP5中的错误..无法加载动态库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10565521/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com