LAMP服务器错误无法初始化模块

在对我的httpd error_log执行尾部-f时,每次请求都收到以下错误消息

[Sun Jun 03 15:52:48 2012] [error] [client xxx.xxx.xxx.xxx] PHP Warning: PHP Startup: timezonedb: Unable to initialize module [Sun Jun 03 15:52:48 2012] [error] [client xxx.xxx.xxx.xxx] Module compiled with module API=20050922 [Sun Jun 03 15:52:48 2012] [error] [client xxx.xxx.xxx.xxx] PHP compiled with module API=20090626 [Sun Jun 03 15:52:48 2012] [error] [client xxx.xxx.xxx.xxx] These options need to match [Sun Jun 03 15:52:48 2012] [error] [client xxx.xxx.xxx.xxx] in Unknown on line 0 

任何帮助解决这个将非常感激。 提前致谢!

您需要安装更新版本的timezonedb PECL扩展。 看起来您使用的版本与您使用的PHP版本不兼容。

编辑1:根据您使用的PHP的操作系统和版本,PHP可能被错误地configuration为加载外部timezonedb扩展。 看一下你的PHPconfiguration文件,看看这行是否存在于其中: extension=timezone.so
如果是这样,暂时注释掉,看看是否解决了你的问题。

编辑2:看看PECL timezonedb的文档:

这个扩展是PHP自带的内置时区数据库的替代品。 你只应该安装这个扩展,以防你需要得到比PHP附带的更新版本的时区数据库。

换句话说,除非您需要比您的PHP版本更新版本的timezonedb,否则不应将其作为外部扩展安装。 在你的情况下,它看起来像PHP试图加载外部扩展,这是与您使用的PHP版本不兼容。 由于PHP已经内置了timezonedb,因此您可以安全地注释掉加载外部扩展的PHPconfiguration文件中的行。

编辑3:尝试使用以下命令更新timezonedb扩展名:

 pecl upgrade timezonedb 

如果这不起作用,请尝试以下操作:

 pecl install timezonedb