The Scourge of Errno.pm on Centos

2011/7/24 18:45

I took this site down over the weekend to rebuild the underlying system from scratch. While reinstalling the APC cache for PHP I got a stubborn error:

$ pecl install apc
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
.................................done: 155,540 bytes
54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
Errno architecture (i386-linux-thread-multi-2.6.9-42.0.3.elsmp) 
does not match executable architecture (i386-linux-thread-multi-2.6.18-53.el5) 
at /usr/lib/perl5/site_perl/5.8.8/Errno.pm line 11.

Compilation failed in require at /usr/share/autoconf/Autom4te/XFile.pm line 90.
BEGIN failed--compilation aborted at /usr/share/autoconf/Autom4te/XFile.pm line 90.
Compilation failed in require at /usr/bin/autom4te line 44.
BEGIN failed--compilation aborted at /usr/bin/autom4te line 44.
ERROR: `phpize' failed

I trusted the Centos yum packages to handle all the other system setup stuff so figured the only errors would come from me. I was actually a bit surprised to see perl used for a PHP application. Checking around on the web, it seems sometimes a second, conflicting, Errno.pm file will appear from one package or another. And by the dictates of Murphy’s Law, my system defaulted to the wrong one...

To fix the error I checked for the files and whether they disagreed about my system's state:

$ diff /usr/lib/perl5/site_perl/5.8.8/Errno.pm \
  /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Errno.pm

12,13c12,13
< "i386-linux-thread-multi-2.6.9-42.0.3.elsmp" or
<     die "Errno architecture (i386-linux-thread-multi-2.6.9-42.0.3.elsmp) 
does not match executable architecture ($Config{'archname'}-$Config{'osvers'})";
---
> "i386-linux-thread-multi-2.6.18-53.el5" or
>     die "Errno architecture (i386-linux-thread-multi-2.6.18-53.el5) 
does not match executable architecture ($Config{'archname'}-$Config{'osvers'})";
15c15
< $VERSION = "1.10";
---
> $VERSION = "1.09_01";
22,26c22,26

Very inconsistent. Fortunately, moving the outdated file out of view resolved the issue and I lost nothing more than an hour of my time.

$ sudo mv /usr/lib/perl5/site_perl/5.8.8/Errno.pm ~/Errno.pm