Redhat 5.9 Lampp libdl.so.2 library issues

We think that some kind of Redhat upgrade broke our Lampp installation, we still haven’t gotten to the bottom of why it started to happen.

instead of Lampp starting Mysql etc, it was just returning the following:

/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory

After much Googling and head scratching we worked out that the script ‘lampp’ wasn’t looking for the library files because it wasn’t recognising the Redhat version that we were running.

Code below showing lines 45 to 62 of the ‘lampp’ script:

45 function osguess() {
46 if test -f /etc/redhat-release
47 then
48 if egrep “9 ” /etc/redhat-release > /dev/null
49 then
50 if egrep “Tikanga” /etc/redhat-release > /dev/null
51 then
52 echo “unknown”
53 return 0
54 fi
55 echo “rh9”
56 return 0
57 fi
58 else
59 echo “unknown”
60 return 0
61 fi
62 }

Line 50 has been changed from “Fedora” to “Tikanga” to represent the release of Redhat that we’re running.

This simple change allows the script to correctly link to the library files required to run the script, without the change, the script didn’t know which version of Redhat was running and then returns 0, which stops the script from looking in the correct place for the library files.

If you open your ‘/etc/redhat-release’ file then edit your lampp script to represent the release, this fix should work for you.

Our file contains:

Red Hat Enterprise Linux Server release 5.9 (Tikanga)

So you know how we knew that our version was “Tikanga”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s