如何解决我的PHP启动警告:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions
/no-debug-non-zts-20090626/imap.so' - /usr/lib/php/extensions/no-debug-non-zts-20090626
/imap.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/php/extensions
/no-debug-non-zts-20090626/mcrypt.so' - /usr/lib/php/extensions/no-debug-non-zts-
20090626/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/php/extensions
/no-debug-non-zts-20090626/memcache.so' - /usr/lib/php/extensions/no-debug-non-zts-
20090626/memcache.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/php/extensions
/no-debug-non-zts-20090626/mysql.so' - /usr/lib/php/extensions/no-debug-non-zts-
20090626/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
/php/extensions/no-debug-non-zts-20090626/mysqli.so' - /usr/lib/php/extensions
/no-debug-non-zts-20090626/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/php/extensions
/no-debug-non-zts-20090626/pdo.so' - /usr/lib/php/extensions/no-debug-non-zts-20090626
/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/php/extensions
/no-debug-non-zts-20090626/pdo_mysql.so' - /usr/lib/php/extensions/no-debug-non-zts-
20090626/pdo_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/php/extensions
/no-debug-non-zts-20090626/suhosin.so' - /usr/lib/php/extensions/no-debug-non-zts-
20090626/suhosin.so: cannot open shared object file: No such file or directory in
Unknown on line 0
我的配置文件夹中有很多配置文件,我不知道它们来自哪里:
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d/gd.ini on
line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d/gd.ini on
line 2 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d/imap.ini
on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d/mcrypt.ini
on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d
/memcache.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d
/mysql.ini
on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d
/mysqli.ini
on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d/pdo.ini
on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d
/pdo_mysql.ini on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d/xcache.ini
on line 1 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/conf.d/xcache.ini
on line 9 in Unknown on line 0
由于警告,我认为我不需要它们?
答案 0 :(得分:3)
mysql_pdo
是用于创建准备好的SQL语句的PHP数据对象扩展。对于mysql_cli
,CLI代表命令行界面。不要删除配置文件,而是打开每个配置文件并删除或更改产生警告的注释(注释以php.ini中的;
开头)
至于动态加载警告,php.ini中有一个名为extension的指令,它看起来类似于以下内容:(这适用于Windows框,* nix会略有不同)
extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
extension=php_mbstring.dll
extension=php_exif.dll
注意一些是如何注释掉的 - 你的php.ini试图动态加载无法找到的扩展名。注释掉正在加载错误扩展名的配置文件中的行,或找到丢失的文件。如果确定您有扩展文件,则可能需要修改php.ini指令extension_dir,但PHP没有“找到”它们。
答案 1 :(得分:0)
我通过设置目录/etc/php.d /
中文件中模块的完整路径解决了这个问题例如gd扩展名: 你只需修改一下:
延长= gd.so
为此:
延长=的/ usr / lib64下/ PHP /模块/ gd.so
因为.so文件位于/ usr / lib64 / modules
答案 2 :(得分:0)
注释掉php.ini文件中导致错误的行:
;extension=imap.so
已经启用了可能的本机支持,但.ini仍在尝试显式调用扩展,这应该对php的功能没有影响,但应该删除错误。