PHP unable to load dynamic library… but it is loaded. WTF

apache-2.2fastcgiPHP

I have a CentOS 5.4 server with Apache 2.2.3, mod_fastcgi and PHP 5.2.11. Everything is working great, server is a production server and I've had no complaints. When I was looking in PHP's error log to diagnose a problem with a specific page, I saw the following periodically repeated over and over:

[03-May-2010 19:54:12] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: undefined symbol: php_rfc1867_callback in Unknown on line 0
[03-May-2010 19:54:12] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0
[03-May-2010 19:54:12] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/apc.so' - /usr/lib/php/modules/apc.so: undefined symbol: php_rfc1867_callback in Unknown on line 0
[03-May-2010 19:54:12] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0

I am very confused because APC is loaded, I can see it in the output of phpinfo(). And by the look of these error messages nothing should be working at all. Yet sites seem to be running fine. How can I track down the source of this error?

Best Answer

I found the culprit, there's some cron job which is running a different version of PHP (/usr/bin/php vs /usr/local/bin/php) and that's what's causing this issue.