From:             helge at eco-logic-software dot de
Operating system: Linux (SuSE 8.1)
PHP version:      5.0.0
PHP Bug Type:     Compile Failure
Bug description:  mysqli can't be compiled

Description:
------------
When trying to configure PHP 5 for compilation under SuSE Linux 8.1 (old
system because it's a production server) and enabling MySQLi support I get
this:

checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check
config.log for more information.

The message seems clear but the problem is that in the given directory the
MySQL 4.1.3 libraries exist (and only there - I used the RPM-devel from the
official homepage). config.log ends with:

configure:54782: checking for MySQLi support
configure:54828: checking whether to enable embedded MySQLi support
configure:54961: checking for mysql_set_server_option in -lmysqlclient
configure:54980: gcc -o conftest -g -O2  -Wl,-rpath,/usr/lib/mysql
-L/usr/lib/mysql  -lmysqlclient -lz -lcrypt -lnsl -lm -lnss_files
-lnss_dns -lresolv -lnss_files -lnss_dns -lresolv conftest.c -L/usr/lib
-lmysqlclient  -lldap -llber -lcrypt -lpam -lfreetype -lpng -lz -ljpeg
-lbz2 -lz -lssl -lcrypto -lresolv -lm -ldl -lnsl  1>&5
/usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/bin/ld:
cannot find -lnss_files
collect2: ld returned 1 exit status
configure: failed program was:
#line 54969 "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_set_server_option();

int main() {
mysql_set_server_option()
; return 0; }

I already tried to apply the patch given in #29329 but that didn't work
either. I also tried changing the paths and so on but that only resulted
in the same error. The libraries are the right ones as the "normal" mysql
support compiles just fine and phpinfo() gives me "MySQL client library:
4.1.3-beta". So normal MySQL support is working just fine with the
libraries but MySQLi support is not. Why, what am I doing wrong?

Reproduce code:
---------------
PHP 5.0.0 source from php.net

./configure --with-openssl --with-zlib --enable-bcmath --with-bz2
--enable-calender --enable-exif --enable-ftp --with-gd --with-png-dir=/usr
--with-jpeg-dir=/usr --with-zlib-dir=/usr --with-ttf=/usr
--with-freetype-dir --enable-gd-native-ttf --with-gettext --with-iconv
--with-imap --with-ldap=/usr --enable-mbstring --with-mime-magic
--enable-sockets --enable-sqlite-utf8 --with-iconv-dir --with-xsl
--with-apxs2=/usr/local/apache2/bin/apxs --disable-libxml
--with-mysql=/usr/lib/mysql --with-mysql-sock=/var/lib/mysql/mysql.sock
--with-mysqli=/usr/bin/mysql_config

(libxml2 is disabled because I can't upgrade to a newer version right now
because of the old glibc in 8.1 - but that shouldn't matter ... or?)

Expected result:
----------------
./configure should finish successfully - as well as the make afterwards,
of course ;-)

Actual result:
--------------
./configure aborts due to the missing MySQL libraries which are
defenitively there.

-- 
Edit bug report at http://bugs.php.net/?id=29619&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29619&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29619&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29619&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29619&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29619&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29619&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29619&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29619&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29619&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29619&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29619&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29619&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29619&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29619&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29619&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29619&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29619&r=float

Reply via email to