Error compiling PHP on CentOS 64 bit

 

In order to compile PHP on 64 bit you need to use the option --with-libdir=lib64 otherwise you will stay forever with the following error

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.

Related posts:

  • naGt

    Very thanks!!

    You solve my problem : )

  • Mike OS

    Great!! This absolutely solved my problem!!

    THANK YOU SO MUCH!
    DOMO ARIGATOU!
    MUCHAS GRACIAS!
    MERCI BEAUCOUP!

  • http://blog.electricmindcontrol.net Tim

    I tend to compile a complete LAMP stack under some special directory (so I know exactly what I’ve got, and don’t have to worry about breaking package management on my system by custom-compiling newer version of things.

    So I end up with a directory like /web, which might contain openssl/ mhash/ libmcrypt/ curl/, etc.

    Just today, I was doing this, but trying to link against the system’s mysql.

    In that setup, –with-libdir=lib64 can cause problems if your various other support libraries stick things in lib/ (as opposed to lib64/). To fix just mysql, and allow other libs to look in lib/, you can try:

    LDFLAGS=-L/usr/lib64/mysql ./configure –with-mysql …

  • Enrico Kern

    thank you…

  • http://www.oxylus-development.com Emanuel G.

    Thanks,

    I was trying for hours to find a solution for the same problem without luck.

  • DaveC

    You saved the day for me :) Thanks!

  • richardwebdezign

    This fix also worked for me for finding gnu idn libraries.

    Thanks

  • http://www.dibb.it Courtney

    setting LDFLAGS=-L/usr/lib64/mysql ./configure –with-mysql works like a charm. When all the other crap failed. configure seems to ignore setting mysql's lib dir to lib64 so for anyone searching and all other fixes fail then this works when mysql has some 32 bit dependencies installed on a 64 bit OS

  • http://www.dibb.it Courtney

    btw you must do
    LDFLAGS=-L/usr/lib64/mysql ./configure –with-mysql

    then LDFLAGS=-L/usr/lib64/mysql make
    running make without setting the ldflag will cause it to fail

    might not be needed for make install but if make install fails then try

    LDFLAGS=-L/usr/lib64/mysql make install

  • http://www.lamnk.com Lamnk

    Thanks Courtney, that's why i always prefer install from a minimal base system no matter what the distro is.

  • Pingback: tok's blog » Install Apache 2 and PHP from source code