CA BD NY
  • Categories

  • Recent Posts

  • RSS MySQL Hacker

  • RSS Apache Hacker

  • RSS MiniCTO

  • Meta

  • Compiling PHP 5.2.9 on CentOS 5.3

    Published May 18th, 2009

    Recently, we were upgrading the development environment to CentOS 5.3 wih PHP 5.2.9 and ran across the following issues. This might help you save some times if you are trying the same so we are sharing the details here.

    When trying to compile PHP 5.2.9 on CentOS 5.3 with the following configuration options:

    #! /bin/sh
    #
    # Created by configure
    
    './configure' \
    '--with-apxs2=/home/apache/bin/apxs' \
    '--with-mysql=/usr/lib' \
    '--with-mysqli=/usr/bin/mysql_config' \
    '--with-gd' \
    '--with-jpeg-dir=/usr/local' \
    '--with-png-dir=/usr/lib' \
    '--with-zlib' \
    '--with-freetype-dir=/usr' \
    '--enable-gd-native-ttf' \
    '--with-ttf' \
    '--with-curl' \
    '--with-pspell' \
    '--enable-mbstring' \
    '--with-mcrypt=/usr/local' \
    '--with-mhash=/usr/local' \
    '--with-libxml-dir=/usr' \
    '--enable-soap' \
    '--enable-ftp' \
    '--enable-zip' \
    '--enable-pcntl' \
    "$@"
    

    we got buncha errors related to MySQL as we wanted both mysql tradtional interface and the mysqi (improved) interface for PHP.

    After investigating a bit, we figured out that libtool-ltdl and libtool-ltdl-devel packages were not installed on the server. So after running yum -y install libtool-ltdl libtool-ltdl-devel to install the packages, we were able to move further in the compilation process but when linking the binaries with libraries in the system, we found the following error:

    gcc: /usr/lib/mysql/libmysqlclient.so: No such file or directory
    

    To fix this, here is what we did, tried to find where the library is currently seating at using locate libmysqlclient.so, which showed:

    /usr/lib/libmysqlclient.so
    /usr/lib/libmysqlclient.so.16
    /usr/lib/libmysqlclient.so.16.0.0
    
  • Since the PHP make script is looking for them in /usr/lib/mysql/libmysqlclient.so directory, it made sense to simply create symbolic link using ln -s /usr/lib/libmysqlclient.so
  • Get a Trackback link

    1 Comments

    1. mihailt on June 14, 2009

      thx we just ran across a similar issue , and your post was great help

    Leave a comment

    Comment Policy: First time comments are moderated. Please be patient.