PHP throws configure errors when trying to compile w/ mysql
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
I have also downloaded a new mysql version and stored it in a different directory and tried the following config string:
I am lost when looking at the config.log, but here is the relevant part:
Code:
configure:58533: checking for mysql_close in -lmysqlclient
configure:58552: gcc -o conftest -I/usr/include -g -O2 -L/usr/lib conftest.c -lmysqlclient -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm 1>&5
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 58541 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mysql_close();
int main() {
mysql_close()
; return 0; }
configure:58773: checking for mysql_error in -lmysqlclient
configure:58792: gcc -o conftest -I/usr/include -g -O2 -L/usr/lib -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient -lz -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm 1>&5
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
configure: failed program was:
#line 58781 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char mysql_error();
int main() {
mysql_error()
; return 0; }
I have been working on this for hours now and I am at the end of my rope. Please help!
Thank you.
I have tried may variations of the --with-mysql including:
--with-mysql=shared
--with-mysql-/usr/lib/mysql (which is where mysql is installed)
Nothing I try works, I always get the error noted above.
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.
Looks like you don't have the mysql-devel rpm installed.
so that the mysql functions were also compiled, but no luck. I got the same errors as before:
Code:
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.
I looked again in the config.log and found this right before the mysql errors:
It looks to me that the line above is not using the correct directory string for -L it should read /usr/lib/mysql. However, I am not a C guy, so I might be wrong.
Still frustrated and will appreciate any help you can give. Thanks.
How did you installed mysql? Using your distro's package manager, using a binary or compiled from source (downloaded from mysql.com)? Cause I never had problems compiling php and using either a binary, or compiled from source mysql. Note that the mysql packages of the various distros are splitted into parts like mysql, mysql-devel, mysql-client etc, so you may need to install all of them to get the required libraries.
How did you installed mysql? Using your distro's package manager, using a binary or compiled from source (downloaded from mysql.com)? Cause I never had problems compiling php and using either a binary, or compiled from source mysql. Note that the mysql packages of the various distros are splitted into parts like mysql, mysql-devel, mysql-client etc, so you may need to install all of them to get the required libraries.
Regards
Initially, it was installed by the distros (FC1) RPMS. However, I also downloaded the latest 4.1.x binaries from mysql.com and stored them in a different location. I then tried to use
Code:
./configure --with-mysql=/path/to/new/mysql
to get it to use the new binaries. Exact same results.
I get this same lmysqlclient error building php-5.1.6 on a CentOS 4.0 64bit x86_64, using the 5.0 binary from mysql.com.
mysql-standard-5.0.24a-linux-x86_64-glibc23
Oddly, it seems to me to be related to openssl. If I tell the configure to use the openssl built from source (openssl-0.9.8c) I receive the error, however if I tell it to use the libraries that came with the distro (OpenSSL 0.9.7a Feb 19 2003) then php builds fine...
Did you install openssl from source? What version are you running?
Sorry for not posting back earlier. I think my problems were glibc related, but I am not absolutely sure. I ended up downloading the mysql 4.1 package under the heading:
Linux (non RPM, Intel C/C++ compiled, glibc-2.3) downloads
and then it worked. I am thinking that if I built everything from source, I wouldn't have had the problem. However, the above solution worked for me. The package I downloaded was:
Anyone have a different fix for this? I am trying to install mysql v5.0.27 and php 5.1.6 and I am getting the same error, I tried changing the ssl directory to the old one and I've tried omitting ssl from it all together and nothing is working
Anyone have a different fix for this? I am trying to install mysql v5.0.27 and php 5.1.6 and I am getting the same error, I tried changing the ssl directory to the old one and I've tried omitting ssl from it all together and nothing is working
Even though you are going with a 5.0.x version, the glibc problem might be the same. Here is the link to the same type of package that I used to fix my problem, but the 5.0.27 version instead of the 4.1.x version:
Even though you are going with a 5.0.x version, the glibc problem might be the same. Here is the link to the same type of package that I used to fix my problem, but the 5.0.27 version instead of the 4.1.x version:
I tried that package first, it am aparently missing some file. I don't even remember what it was, but I can't run the install_db script. I think it was something in the gcc package, but being on dialup kills downloading a lot of 40mb packages when you are in a rush.
I am just going to wait until I get my drive back that has the slack 11 iso on it. See if it works, but damn this is discouraging.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.