Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

While doing a tail -f on my httpd error_log I got the following error on every request

[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

Any help on fixing this will be very appreciated. Thanks in advance!

share|improve this question
    
Can you provide the operating system you're using and the version of PHP? –  Richard Keller Jun 3 '12 at 12:14
    
CentOS Linux 5.8, PHP Version 5.3.6 –  Barry Kooij Jun 3 '12 at 12:39
add comment

1 Answer

up vote 0 down vote accepted

You need to install a newer version of the timezonedb PECL extension. Looks like the version you're using isn't compatible with the version of PHP you're using.

Edit 1: Depending on the OS and version of PHP you're using, PHP might be incorrectly configured to load an external timezonedb extension. Take a look in your PHP config file and see whether this line exists somewhere in it: extension=timezone.so
If so, comment it out temporarily, and see whether that fixes your problem.

Edit 2: Take a look at the documentation for PECL timezonedb :

This extension is a drop-in replacement for the builtin timezone database that comes with PHP. You should only install this extension in case you need to get a later version of the timezone database than the one that ships with PHP.

In other words, unless you require a newer version of timezonedb than what is shipped with your version of PHP, you shouldn't install it as an external extension. In your case it looks like PHP is trying to load the external extension, which is incompatible with the version of PHP that you're using. Since PHP already has timezonedb built-in, you can safely comment out the line in your PHP config file which loads the external extension.

Edit 3: Try updating the timezonedb extension using the following command:

pecl upgrade timezonedb

If that doesn't work, try the following:

pecl install timezonedb
share|improve this answer
    
I've comment out the line "extension=timezonedb.so" and the error stopped showing up. Is this fixing the problem or just avoiding it? –  Barry Kooij Jun 3 '12 at 12:35
    
Correction: It still shows up. –  Barry Kooij Jun 3 '12 at 12:37
    
I've updated my answer. –  Richard Keller Jun 3 '12 at 12:43
    
Upgrading the timezone did the trick! I did had to re-enable the "extension=timezonedb.so" option. Thanks allot! –  Barry Kooij Jun 3 '12 at 12:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.