LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Trouble configuring PHP to use MySQL (https://www.linuxquestions.org/questions/linux-server-73/trouble-configuring-php-to-use-mysql-524548/)

benrose111488 01-31-2007 10:27 PM

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!

reddazz 02-01-2007 03:14 PM

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.

benrose111488 02-01-2007 03:22 PM

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.

reddazz 02-01-2007 03:41 PM

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.

benrose111488 02-01-2007 05:10 PM

can you help me figure out what path it should be? I'm going nuts over here trying to get this to work...

reddazz 02-02-2007 05:16 AM

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


All times are GMT -5. The time now is 09:44 PM.