LinuxQuestions.org
Visit Jeremy's Blog.
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 01-31-2007, 10:27 PM   #1
benrose111488
Member
 
Registered: Jun 2004
Location: Wantage, NJ
Distribution: Fedora 7
Posts: 177

Rep: Reputation: 30
Question Trouble configuring PHP to use MySQL


Hey everyone,

I'm having a problem getting PHP to configure properly when setting the --with-mysql flag. I've tried setting it equal to every single possible directory I've ever seen remotely relating to mysql, and nothing works at all. I've googled it to infinity, and some people have gotten it to all work, but never leave comments as to HOW they got it to work. Here's the command I'm executing:

Code:
./configure --build=i386-redhat-linux --host=i386-redhat-linux --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --cache-file=../config.cache --with-libdir=lib --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-pic --disable-rpath --with-bz2 --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-expat-dir=/usr --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic=/etc/httpd/conf/magic --with-sqlite --with-libxml-dir=/usr --with-xml --with-swf=/usr --with-imap --with-imap-ssl --without-adabas --enable-dbx --enable-dbase --enable-filepro --without-fbsql --with-gdbm=/usr/include/gdbm --with-hyperwave --with-ldap --with-msql --without-ndbm --with-ovrimos --without-oci8 --without-oracle --with-pgsql --with-solid --with-cybercash --enable-freetype-4bit-antialias-hack --with-gd --with-imagick --with-t1lib --with-tiff-dir --with-ttf --with-xpm-dir --enable-bcmath --enable-calendar --enable-debug --enable-exif --enable-force-cgi-redirect --enable-libgcc --with-java --with-readline --with-ming --with-zlib --enable-overload --with-snmp --with-aspell --with-iconv --without-pspell --with-recode --enable-shmop --with-mysql=shared,/usr/local/lib/mysql
And here's the relevent output:

Code:
checking for MySQL support... yes, shared
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.
Relevent config.log:

Code:
configure:57721: checking for MySQL support
configure:57767: checking for specified location of the MySQL UNIX socket
configure:57824: checking for MySQL UNIX socket location
configure:58014: checking for mysql_close in -lmysqlclient
configure:58033: gcc -o conftest -I/usr/include -g  -O0  -Wl,-rpath,/usr/local/lib/mysql -L/usr/local/lib/mysql -L/usr/lib  -Wl,-rpath,/usr/lib/gcc/i386-redha$/usr/bin/ld: cannot find -lmsql
collect2: ld returned 1 exit status
configure: failed program was:
#line 58022 "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:58254: checking for mysql_error in -lmysqlclient
configure:58273: gcc -o conftest -I/usr/include -g  -O0  -Wl,-rpath,/usr/local/lib/mysql -L/usr/local/lib/mysql -L/usr/lib  -Wl,-rpath,/usr/lib/gcc/i386-redha$/usr/bin/ld: cannot find -lmsql
collect2: ld returned 1 exit status
configure: failed program was:
#line 58262 "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_close()
; return 0; }
configure:58254: checking for mysql_error in -lmysqlclient
configure:58273: gcc -o conftest -I/usr/include -g  -O0  -Wl,-rpath,/usr/local/lib/mysql -L/usr/local/lib/mysql -L/usr/lib  -Wl,-rpath,/usr/lib/gcc/i386-redha$/usr/bin/ld: cannot find -lmsql
collect2: ld returned 1 exit status
configure: failed program was:
#line 58262 "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 no idea what it's even looking for!!! I've consulted the PHP and MySQL bug reports, and this seems to be a bug for 64-bit systems, but this is being installed on an i386 with 1 processor.

Any ideas? Need more info? Lemme know...

Thanks in advance!
 
Old 02-01-2007, 03:14 PM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Did you compile mysql from source or are you using packages from your distro. If you are using packages from your distro, install the mysql client devel packages and see if that solves the problem. If you compiled from source, make sure you are pointing to the right mysql directory e.g. /usr/local/mysql on most local compilations.
 
Old 02-01-2007, 03:22 PM   #3
benrose111488
Member
 
Registered: Jun 2004
Location: Wantage, NJ
Distribution: Fedora 7
Posts: 177

Original Poster
Rep: Reputation: 30
they're installed. Here's info on relevent output from yum and rpm -aq:

yum list | grep -i mysql
Code:
libdbi-dbd-mysql.i386                    0.8.1a-1.2.2           installed
libpreludedb-mysql.i386                  0.9.11.1-2.fc6         installed
mod_auth_mysql.i386                      1:3.0.0-3.1            installed
mysql.i386                               5.0.27-1.fc6           installed
mysql-devel.i386                         5.0.27-1.fc6           installed
mysql-server.i386                        5.0.27-1.fc6           installed
pam_mysql.i386                           1:0.6.2-4.fc6          installed
perl-DBD-MySQL.i386                      3.0007-1.fc6           installed
php-mysql.i386                           5.1.6-3.3.fc6          installed
MySQL-python.i386                        1.2.1-1                core
bytefx-data-mysql.i386                   1.1.17.1-4.fc6         updates
compat-gda-mysql.i386                    1.2.4-1.fc6            extras
freeradius-mysql.i386                    1.1.3-1.1              updates
gnokii-smsd-mysql.i386                   0.6.14-2.fc6           extras
koffice-kexi-driver-mysql.i386           1.6.1-4.fc6            extras
libgda-mysql.i386                        1:1.9.100-10.fc6       extras
lighttpd-mod_mysql_vhost.i386            1.4.13-3.fc6           extras
mysql-administrator.i386                 1.1.10-3.fc6           extras
mysql-bench.i386                         5.0.27-1.fc6           updates
mysql-connector-java.i386                1:3.1.12-3.fc6         extras
mysql-connector-odbc.i386                3.51.12-2.2            core
mysql-gui-common.i386                    1.1.10-3.fc6           extras
mysql-query-browser.i386                 1.1.18-4.fc6           extras
mysql-test.i386                          5.0.27-1.fc6           updates
mysqlclient10.i386                       3.23.58-9.2.1          core
mysqlclient10-devel.i386                 3.23.58-9.2.1          core
mysqlclient14.i386                       4.1.14-4.2.1           core
mysqlclient14-devel.i386                 4.1.14-4.2.1           core
nagios-plugins-mysql.i386                1.4.5-1.fc6            extras
openpbx-mysql.i386                       1.2-3.rc2.svn2282.fc6  extras
pdns-backend-mysql.i386                  2.9.20-8.fc6           extras
perl-Class-DBI-mysql.noarch              1.00-2.fc6             extras
perl-DateTime-Format-MySQL.noarch        0.04-4.fc6             extras
perl-Time-Piece-MySQL.noarch             0.05-3.fc6             extras
php-pear-MDB2-Driver-mysql.noarch        1.3.0-1.fc6            extras
proftpd-mysql.i386                       1.3.0a-1.fc6           extras
pyicq-t-mysql.noarch                     0.8-1.fc6              extras
qt-MySQL.i386                            1:3.3.7-0.1.fc6        updates
qt4-mysql.i386                           4.2.2-1.fc6            extras
rekall-mysql.i386                        2.4.5-5.fc6            extras
ruby-mysql.i386                          2.7.1-2.fc6            extras
ser-mysql.i386                           0.9.6-9.fc6            extras
showimg-mysql.i386                       0.9.5-12.fc6           extras
snort-mysql.i386                         2.6.1.1-4.fc6          extras
snort-mysql+flexresp.i386                2.6.1.1-4.fc6          extras
ulogd-mysql.i386                         1.24-2.fc6             extras
rpm -aq | grep -i mysql
Code:
perl-DBD-MySQL-3.0007-1.fc6
mysql-server-5.0.27-1.fc6
php-mysql-5.1.6-3.3.fc6
pam_mysql-0.6.2-4.fc6
mod_auth_mysql-3.0.0-3.1
mysql-5.0.27-1.fc6
libpreludedb-mysql-0.9.11.1-2.fc6
libdbi-dbd-mysql-0.8.1a-1.2.2
mysql-devel-5.0.27-1.fc6
right now i tried configuring php with mysqli support as opposed to mysql, same error. So now i'm trying to download the matching version's source, configuring, and making, but not installing, and then copying the correct built lib files to some directories that it appears configure looks in. I'll let you know what happens.

Let me know if you need any more output or information or if you have any ideas. Thanks for your help.
 
Old 02-01-2007, 03:41 PM   #4
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
It seems to me that in your ./configure section, you are pointing php to the wrong mysql directory. If you have installed from distro packages, then the mysql path is not /usr/local/lib/mysql.
 
Old 02-01-2007, 05:10 PM   #5
benrose111488
Member
 
Registered: Jun 2004
Location: Wantage, NJ
Distribution: Fedora 7
Posts: 177

Original Poster
Rep: Reputation: 30
can you help me figure out what path it should be? I'm going nuts over here trying to get this to work...
 
Old 02-02-2007, 05:16 AM   #6
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
I don't really know what the path is because I normally compile amp from source. Try /usr/lib/mysql and /var/lib/mysql.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Configuring Apache, PHP AND mySql Stryks Linux - Newbie 2 10-14-2004 02:02 AM
Trouble on PHP & MySQL Quotes Gerardoj Programming 0 05-26-2004 09:48 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
Configuring PHP with MySQL pembo13 Linux - Software 5 09-24-2003 06:07 PM
configuring PHP with MYSQL saravanan1979 Linux - Software 0 11-07-2002 11:10 PM


All times are GMT -5. The time now is 07:22 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration