After an php upgrade on one of my web hosts i have gotten an strange error, it tells me that the libxml2.so.2 package is corrupt.

I got the following error thrown in the php-cli and php commands. It appears in various logs aswell..
php: /usr/local/lib/libxml2.so.2: no version information available (required by php)

I found a solution to the problem, _its just a workaround_ as this error is telling me that the libxml2 package is broken and it needs to be rebuilt. I have built mine from source and it is/was a pain in the ass to get to work. apt-get doesn’t give me the version i want. I know i could always do it but this server is a critical part and can’t be offline that long. I have started building the server from scratch and will move the code/files to this server in a couple of weeks.

Anyways, when this problem was found i ran locate libxml2.so.2 in the console and i found the library in two different places. It should only exist in one place. Mine was in /usr/local/lib and /usr/lib. The file in /usr/lib seems to be the correct working one, so i tried to delete the other one, it didn’t work. After reading around on google i found that this file could exist in two places but there should only be one lib file, the other one should be a symlink.

So i tried to delete the wrong one, and replace it with and symlink to the source file. Boom, it worked.

cd /usr/local/lib/
rm libxml2.so.2
ln -s /usr/lib/libxml2.so.2.7.8 libxml2.so.2
0