我的 php 已正确安装并正常运行,但在 Apache 启动时,我所有当前加载的扩展都出现了警告消息,例如......
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: bz2: Unable to initialize module
Module compiled with build ID=API20131226,NTS
PHP compiled with build ID=API20131226,TS
These options need to match
in Unknown on line 0
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: calendar: Unable to initialize module
Module compiled with build ID=API20131226,NTS
PHP compiled with build ID=API20131226,TS
These options need to match
in Unknown on line 0
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: ctype: Unable to initialize module
Module compiled with build ID=API20131226,NTS
PHP compiled with build ID=API20131226,TS
These options need to match
in Unknown on line 0
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/curl.so' - /usr/lib64/php/modules/curl.so: undefined symbol: compiler_globals in Unknown on line 0
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/dom.so' - /usr/lib64/php/modules/dom.so: undefined symbol: executor_globals in Unknown on line 0
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/exif.so' - /usr/lib64/php/modules/exif.so: undefined symbol: compiler_globals in Unknown on line 0
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/fileinfo.so' - /usr/lib64/php/modules/fileinfo.so: undefined symbol: file_globals in Unknown on line 0
[23-Dec-2015 21:47:45 UTC] PHP Warning: PHP Startup: ftp: Unable to initialize module
Module compiled with build ID=API20131226,NTS
PHP compiled with build ID=API20131226,TS
These options need to match
in Unknown on line 0
等等...
如您所见,当前扩展目录设置为/usr/lib64/php/模块
但据我所知,php for mpm 事件已加载到 php.conf 中...
加载模块 php5_module 模块/libphp5-zts.so
所以,问题是......我需要从 /usr/lib64/ 加载扩展吗php-zts/模块?
谢谢
答案1
答案是否定的,但是发现了问题。
使用 mpm 事件 + fcgid 显然任何虚拟主机的 php.ini 都在 ../home/user/etc/php5 中,因此在主 /etc/php.ini(prefork 时...)之前手动设置为 /usr/lib64/php/modules,并且不适合编辑 /etc/php.ini 进行测试。
必须为用户编辑任何 php.ini 并注释掉 extension_dir 行...不再有有关扩展的警告消息。