LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-13-2006, 03:36 PM   #1
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Rep: Reputation: 31
PHP throws configure errors when trying to compile w/ mysql


I am trying to compile PHP 5.1.6 with support for MySQL 4.1.x on a Fedora Core 1 VPS. This is my config string:

Code:
./configure --with-apxs2=/usr/sbin/apxs --with-mysql
and this is always the result

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 have also downloaded a new mysql version and stored it in a different directory and tried the following config string:

Code:
./configure --with-apxs2=/usr/sbin/apxs --with-mysql=../mysql/usr/lib/mysql --with-zlib
but I get the same error as above.

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.

Last edited by mrtwice; 09-13-2006 at 04:30 PM.
 
Old 09-13-2006, 07:06 PM   #2
generic_user
Member
 
Registered: Sep 2006
Location: San Francisco, Ca.
Distribution: Redhat/Fedora/CentOS
Posts: 39

Rep: Reputation: 15
[QUOTE=mrtwice]I am trying to compile PHP 5.1.6 with support for MySQL 4.1.x on a Fedora Core 1 VPS. This is my config string:

Code:
./configure --with-apxs2=/usr/sbin/apxs --with-mysql
and this is always the result

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.

Looks like you don't have the mysql-devel rpm installed.
 
Old 09-14-2006, 01:50 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Try to add
Code:
–with-mysqli=/path/to/mysql/bin/mysql_config
It's needed in php 5.x version

Last edited by bathory; 09-14-2006 at 12:51 PM.
 
Old 09-14-2006, 09:29 AM   #4
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory
Try to add
Code:
–with-mysqli=/path/to/mysql//bin/mysql_config
It's needed in php 5.x version
Code:
./configure --with-apxs2=/usr/sbin/apxs --with-mysqli=/usr/bin/mysql_config --with-zlib
The line above worked just fine. However, when I compiled, the mysql functions were not available, just the mysqli functions.

I also tried:

Code:
./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr/lib/mysql --with-mysqli=/usr/bin/mysql_config --with-zlib
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:

Code:
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
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.
 
Old 09-14-2006, 12:50 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 09-14-2006, 04:34 PM   #6
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by generic_user
Looks like you don't have the mysql-devel rpm installed.
No, it is installed.
 
Old 09-14-2006, 04:38 PM   #7
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by bathory
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.
 
Old 09-27-2006, 07:23 PM   #8
waitman
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
lmysqlclient error php install

Hi,

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?

Take care,

Waitman
 
Old 09-27-2006, 08:01 PM   #9
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Original Poster
Rep: Reputation: 31
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:

mysql-standard-4.1.21-pc-linux-gnu-i686-icc-glibc23.tar.gz

I hope that helps.
 
Old 10-29-2006, 08:08 PM   #10
DIGITAL39
Member
 
Registered: Sep 2003
Location: Virginia
Distribution: Slackware, CentOS, Red Hat
Posts: 48

Rep: Reputation: 15
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
 
Old 10-29-2006, 08:28 PM   #11
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by DIGITAL39
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:

http://dev.mysql.com/get/Downloads/M.../mysql.he.net/
 
Old 10-29-2006, 08:43 PM   #12
DIGITAL39
Member
 
Registered: Sep 2003
Location: Virginia
Distribution: Slackware, CentOS, Red Hat
Posts: 48

Rep: Reputation: 15
Quote:
Originally Posted by mrtwice
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:

http://dev.mysql.com/get/Downloads/M.../mysql.he.net/
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.
 
Old 10-30-2006, 03:24 AM   #13
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Since you're using a 64bit arch you should try the 64bit build or compile mysql from source

Regards
 
Old 10-30-2006, 06:36 AM   #14
DIGITAL39
Member
 
Registered: Sep 2003
Location: Virginia
Distribution: Slackware, CentOS, Red Hat
Posts: 48

Rep: Reputation: 15
Quote:
Originally Posted by bathory
Since you're using a 64bit arch you should try the 64bit build or compile mysql from source

Regards
I dont have any 64bit machines
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP 5 configure error with mysql kamran_pro Linux - Software 7 08-15-2007 08:00 AM
errors in php/mysql skybell Slackware 13 11-11-2005 10:59 PM
ncurses and ncursed-dev are present but the App install throws errors? ServerStorm Linux - Software 16 01-05-2005 04:11 PM
PHP ./configure command dilema (for mysql) tuka Linux - Newbie 2 11-03-2003 09:26 PM
How do i configure RH-9, apache 2.0, php and mysql rolling_titan Linux - General 4 10-18-2003 06:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration