I received the below error when compiling PHP to work as an external application with the Litespeed API. When you do compile this it’s called the PHP LSAPI module which is then used by Litespeed to process PHP.

PHP Build Error:

configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

The issue was that I the MySQL server version was 64-bit and the php compile script was looking for 32-bit libraries. To see if your MySQL server is 64-bit or 32-bit check the version by issuing the below command and looking for a response also shown below.

MySQL Version:

[root@server php-5.2.8]# mysql --version
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (x86_64) using readline 5.0

To resolve the issue add the below configuration options to your PHP configure script.

Options to Add:

--with-mysql=/usr/bin/ --with-libdir=lib64

So my PHP configure script after adding these options now looked like the below which resolve the compile error.

PHP Configure Script:

./configure --prefix=/var/lsws/lsphp5 --with-litespeed --with-mysqli --with-mcrypt --with-mysql=/usr/bin/ --with-libdir=lib64 --with-zlib --with-gd --enable-shmop
--enable-track-vars --enable-sockets --enable-sysvsem --enable-sysvshm --enable-magic-quotes --enable-mbstring --with-iconv

SQL Pocket Guide (Paperback)

By (author): Jonathan Gennick


List Price: $14.99 USD
New From: $8.24 USD In Stock
Used from: $3.46 USD In Stock

MySQL High Availability: Tools for Building Robust Data Centers (Paperback)

By (author): Charles Bell, Mats Kindahl, Lars Thalmann


List Price: $49.99 USD
New From: $22.95 USD In Stock
Used from: $13.74 USD In Stock

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , , , , , , , ,
6 Responses to “configure: error: Cannot find libmysqlclient under /usr”
  1. Artorios Rex says:

    You may want to encapsulate the code with tags... when I copied and pasted it into a terminal window, the "--" got converted to a Unicode long hyphen. Thanks!

    [Reply]

    alex Reply:

    Hello Artorios Rex,

    Sure thing.. thanks for pointing out. This article was written before we started using a custom method to wrap code. The article has been updated. Thanks for taking the time to leave a note with this request.

    Thanks.
    alex

    [Reply]

  2. Artorios Rex says:

    Grrr… <code> tags

    [Reply]

    alex Reply:

    Hello Artorios Rex,

    One message noting your request would have been sufficient. This second one is just annoying especially venting frustration for an article we took the time to write in our free time as an effort to help others resolve an issue. Anyhow the article needed to be updated so for pointing it out the first time we appreciate the note.

    Thanks.
    alex

    [Reply]

  3. Artorios Rex says:

    Sorry, Alex. That was entirely my fault. I neglected to use & lt; and & gt; entities in my first comment and couldn’t edit it to put them in. I should have clarified that in the second comment. Thanks again for the tip. I was really pulling my hair out over that one.

    [Reply]

    alex Reply:

    Hello Artorios Rex,

    No worries man! I didn’t even catch the tags part… I thought you were just double posting… :) Regardless all that really matters is the article helped you out and you took the time to let me know that the format was out of whack which allowed me to fix it and make it easier for the next person that needs this information! Thanks again!

    Thanks.
    alex

    [Reply]

  4.  
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*