PHP relocation error

This will be quick tutorial about how to fix PHP relocation error like this one: php: symbol zlibVersion , version libmysqlclient_16 not defined in in file with link time reference. Instead php: relocation error: php: symbol zlibVersion the error could be php: relocation error: php: symbol crc32.

This is an example and the issue could happen with any shared library not only with .

As per the error message the library version is not matching so we have to check the shared library dependencies. This can be done with tool called ‘ldd’ which prints the shared library dependencies. In this case we will check PHP for “libmysqlclient” so the command should be like this:

Or if for some reason the PHP binary is located elsewhere:

The output should be similar to this one:

Let’s check the file:

In my case this is a symbolic link to the library in the same folder:

Now let’s check if this file exist in another place.

My output is:

So there are two libraries, and now we have to check where is the missing symbol – for example zlibVersion. For that will use ‘nm’ command lists symbols from object files. Let’s try the current linked file:

The output is:

So it seams there are no symbols in this library.

With the other file:

The output is:

Which seams better.

Now I will just remote the current link:

And will create a new one with the library that contains the symbol:

This should resolve the case, and the php: symbol zlibVersion , version libmysqlclient_16 not defined in in file with link time reference error was solved.


Filed Under: Apache Web ServerLinuxPHPSystemTutorialsWeb servers

Anthony Gee About the Author: Anthony G. is an IT specialist with more than 9 years of solid working experience in the Web Hosting industry. Currently works as server support administrator, involved in consultative discussions about Web Hosting and server administration. One of the first writers in the website, now writing for Free Tutorials community - he is publishing tutorials and articles for the wide public, as well as specific technical solutions.

Comments (13)

  1. ezekiel says:

    Thank you for this tutorial, is saved me today to fix a server.

  2. Yulianto says:

    my VPs centos 6.2 php 5.3.10…with this tutorial can’t success. how do fix this problem with centos 6.2?


  3. Yulianto says:

    after –>
    ls -la /usr/lib64/mysql/
    only show >

    what it means?
    thank their concern..

  4. Yulianto says:

    when i type: updatedb && locate

    -bash: updatedb: command not found

    how to fix this?

  5. Yulianto says:

    ok, thank its work normally for me…thank’s for share

  6. prisoner says:

    You saved my ass… 2 hours searching a working workaround with no success.

    Thank You

  7. anoop says:

    bingo! you saved my day! thanks! :)

  8. Ajay says:


    I have followed all the above steps and found that there is no link present between two files, so i have created the same. But still it is throwing the same error. Please revert

  9. Hany Samir says:

    you saved my day! thanks! :)

Leave a Reply