PHP启动:无法为PHP文件夹加载动态库

时间:2019-02-16 13:00:17

标签: php ubuntu nginx curl digital-ocean

我已经引用了链接PHP5 similar issue

并尝试了所有相关的解决方案,但我仍然遇到以下问题。任何帮助表示赞赏。谢谢!

  

PHP警告:PHP启动:无法加载动态库'/usr/lib/php/20131226/msql.so'-/usr/lib/php/20131226/msql.so:无法打开共享库文件:否这样第0行上“未知”中的文件或目录   PHP警告:PHP启动:无法加载动态库'/usr/lib/php/20131226/php_pdo_mysql.dll'-/usr/lib/php/20131226/php_pdo_mysql.dll:无法打开共享库文件:没有此类文件或目录在第0行的Unknown中   PHP 5.6.38-3 + ubuntu14.04.1 + deb.sury.org + 1(CLI)   版权所有(c)1997-2016 The PHP Group   Zend Engine v2.6.0,版权所有(c)1998-2016 Zend Technologies       与Zend OPcache v7.0.6-dev,Zend Technologies版权所有(c)1999-2016

1 个答案:

答案 0 :(得分:2)

您的php .ini配置文件引用了多个不存在的文件,例如/usr/lib/php/20131226/php_pdo_mysql.dll,您的php安装已损坏。重新安装PHP可能更容易,但是如果您想手动修复PHP,请创建一个名为phpinfo.php的页面并包含

<?php phpinfo(~0);

并在浏览器中打开它,您将获得php.ini的位置以及已解析的其他ini配置文件的列表,一旦找到,请扫描php.ini文件以及所有其他配置文件,然后删除对不存在的文件的所有引用。例如此屏幕截图:

enter image description here

在这里,您必须扫描文件/etc/php/7.0/fpm/php.ini/etc/php/7.0/fpm/conf.d/10-mysqlnd.ini/etc/php/7.0/fpm/conf.d/10-opcache.ini/etc/php/7.0/fpm/conf.d/10-pdo.ini/etc/php/7.0/fpm/conf.d/15-xml.ini/etc/php/7.0/fpm/conf.d/20-calendar.ini和{{ 1}}和/etc/php/7.0/fpm/conf.d/20-ctype.ini/etc/php/7.0/fpm/conf.d/20-curl.ini/etc/php/7.0/fpm/conf.d/20-dom.ini/etc/php/7.0/fpm/conf.d/20-exif.ini/etc/php/7.0/fpm/conf.d/20-fileinfo.ini/etc/php/7.0/fpm/conf.d/20-ftp.ini/etc/php/7.0/fpm/conf.d/20-gd.ini和{{1} }和/etc/php/7.0/fpm/conf.d/20-gettext.ini/etc/php/7.0/fpm/conf.d/20-iconv.ini/etc/php/7.0/fpm/conf.d/20-json.ini/etc/php/7.0/fpm/conf.d/20-mbstring.ini/etc/php/7.0/fpm/conf.d/20-mysqli.ini/etc/php/7.0/fpm/conf.d/20-pdo_mysql.ini/etc/php/7.0/fpm/conf.d/20-pdo_sqlite.ini/etc/php/7.0/fpm/conf.d/20-phar.ini/etc/php/7.0/fpm/conf.d/20-posix.ini/etc/php/7.0/fpm/conf.d/20-readline.ini/etc/php/7.0/fpm/conf.d/20-shmop.ini/etc/php/7.0/fpm/conf.d/20-simplexml.ini/etc/php/7.0/fpm/conf.d/20-sockets.ini/etc/php/7.0/fpm/conf.d/20-sqlite3.ini/etc/php/7.0/fpm/conf.d/20-ssh2.ini/etc/php/7.0/fpm/conf.d/20-sysvmsg.ini和{{ 1}}和/etc/php/7.0/fpm/conf.d/20-sysvsem.ini/etc/php/7.0/fpm/conf.d/20-sysvshm.ini/etc/php/7.0/fpm/conf.d/20-tokenizer.ini/etc/php/7.0/fpm/conf.d/20-wddx.ini/etc/php/7.0/fpm/conf.d/20-xdebug.ini  引用不存在的文件,并删除那些引用...玩得开心

(但是,严重的是,最好重新安装所需的PHP版本。根据您的评论,我看到您已经安装了多个PHP版本。)