Lampp – error while loading shared libraries: libc.so.6 xampp – Centos

Recently while restarting lampp server I got following error, which is used to work previously:

cat: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
/bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
Starting XAMPP for Linux ...
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
/bin/bash: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
XAMPP for Linux started.

To resolve this issue I read some forums, tried some solutions. After struggling couple hours I got the solution.

Following is the solution that worked for me:

Open lampp file in your server and search for the line redhat-release.

Most probably you can find this at line number 50 in laamp script, it should looks like following:

if egrep "Fedora" /etc/redhat-release > /dev/null

For CentOS we need to replace Fedora with CentOS, after changing like looks like following:

if egrep "CentOS" /etc/redhat-release > /dev/null

After making above changes try to start lampp with following and it should work without any issue.

$ /opt/lampp/lampp start
or
./lampp start

where /opt/lampp is root directory of lampp server.

-Sany

27 comments on “Lampp – error while loading shared libraries: libc.so.6 xampp – Centos

  1. Pingback: Fedora or Tikanga ? | Not so many...

  2. Hi guys,
    It didn’t work for me 😦

    if egrep “CentOS” /etc/redhat-release > /dev/null

    When I try to start we receive the same error above, I am using Red HAT.

  3. In a system when the /etc/redhat-release is

    “Red Hat Enterprise Linux Server release 5.3”, the same lampp works

    but in a system when the /etc/redhat-release is

    “Red Hat Enterprise Linux Server release 5.9”, the same lampp does not work

    this sets the osguess value as rh9 .

    SInce this was an issue, I have changed the redhat-release temporarily to non 5.9 value

    Can I know what is the purpose of egrep egrep ‘9 ‘ /etc/redhat-release?

    • Hi Sarvanan,

      I am not sure about exact reason, but wile reading couple forums people are suggested to use this trick and its worked for me, so thought to share it.
      The only clue I got to know is while updating/installing this file may get updated. So people are suggesting to revert it back.

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

    Had the same issue as Denis on Red Hat, but I changed line 50:

    [if egrep “Fedora” /etc/redhat-release > /dev/null]
    to
    [if egrep “Red” /etc/redhat-release > /dev/null]

    and it works fine.

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