#42926 [Opn]: suggestion for finding mysql lib on AIX, also model for include directory

From: Date: Thu, 11 Oct 2007 14:01:27 +0000
Subject: #42926 [Opn]: suggestion for finding mysql lib on AIX, also model for include directory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-118406@lists.php.net to get a copy of this message
ID: 42926 User updated by: mamfelt at acm dot org -Summary: Problems with configure script on AIX with mysql 64-bit Reported By: mamfelt at acm dot org Status: Open Bug Type: MySQL related Operating System: AIX 5.3 TL06 PHP Version: 5.2.4 New Comment: line 59490 and further as an example: if test -z "$PHP_LIBDIR"; then PHP_LIBDIR=lib fi for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do str="$MYSQL_DIR/$i/lib$MYSQL_LIBNAME.*" for j in echo $str; do if test -r $j; then MYSQL_LIB_DIR=$MYSQL_DIR/$i break 2 fi on AIX you could make the default directory PHP_LIBDIR=[b]mysql[/b] so that the string would be /usr/local/mysql/lib (rather than only having /usr/local/lib/mysql succeed) The code for locating the include directory would be assisted by a similiar patch. Previous Comments: ------------------------------------------------------------------------ [2007-10-11 13:49:15] mamfelt at acm dot org Hmm: second entry, threw my first reply away - learning here. One: When I first installed the AIX distribution from mysql six years ago, they suggested the symbolic link because the commands (scripts, etc.) expect /usr/local/mysql as the location. Two: The naming convention for AIX distributions is to state the lowest level of AIX needed to run the distribution on. As the aix5.2 distribution is the highest AIX level distributed it is intended for AIX 5.2 and AIX 5.3, but not for AIX 5.1 or before. Three: mysql is running with no (known) problems on my system. ------------------------------------------------------------------------ [2007-10-11 13:24:31] jani@php.net And I don't think an AIX 5.2 package of mysql works with AIX 5.3: /data/home/michael/mysql-5.0.45-aix5.2-powerpc-64bit ------------------------------------------------------------------------ [2007-10-11 13:21:51] jani@php.net Seems more like you're trying to outsmart both PHP and Mysql here. Why don't you just install the mysql libs like they should be installed and forget those hacks with symlinks? ------------------------------------------------------------------------ [2007-10-11 12:09:28] mamfelt at acm dot org Description: ------------ On a fresh install of AIX 5.3 at TL 06-03 I am trying to configure php5. I was not expecting it to work perfectly on the first pass, because I am also using the IBM compiler as part of the test, rather than gcc. System: AIX 5.3, Power4, 64-bit mode, jfs2 filesystems Compiler: xlC/C++ 7 with latest patches from July 2007 The first problem I run into is that configure wants the file: xml2-config. I tried loading the AIX Toolbox package for libxml2, but this package does not include the file xml2-config. This problem I could resolve by downloading the source package (libxml2-2.6.30), running config, make, and make install. The next problem involved finding the mysql include and lib files. I have the 64-bit version of mysql loaded: michael@x054:[/usr/local]ls -l mysql lrwxrwxrwx 1 root system 52 Oct 09 22:28 mysql -> /data/home/michael/mysql-5.0.45-aix5.2-powerpc-64bit The mysql distributions have a standard layout. The include/lib files are located at: /usr/local/mysql/include and /usr/local/mysql/lib These two errors were resolved my adding two symbolic links: michael@x054:[/usr/local/include]ls -l total 160 drwxr-xr-x 3 root system 256 Oct 09 22:31 libxml2 lrwxrwxrwx 1 root system 16 Oct 09 22:42 mysql -> ../mysql/include -rw-r--r-- 1 root system 9544 Oct 11 12:54 zconf.h -rw-r--r-- 1 root system 66188 Oct 11 12:54 zlib.h michael@x054:[/usr/local/lib]ls -l total 10384 -rwxr-xr-x 1 root system 5200148 Oct 09 22:31 libxml2.a -rwxr-xr-x 1 root system 785 Oct 09 22:31 libxml2.la -rwxr-xr-x 1 root system 103558 Oct 11 12:54 libz.a lrwxrwxrwx 1 root system 12 Oct 09 22:54 mysql -> ../mysql/lib drwxr-xr-x 2 root system 256 Oct 09 22:31 pkgconfig -rw-r--r-- 1 root system 225 Oct 09 22:31 xml2Conf.sh The final errors that I could not resolve regard the search for some mysql functions: checking for MySQL support... yes checking for specified location of the MySQL UNIX socket... no checking for MySQL UNIX socket location... /tmp/mysql.sock 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. michael@x054:[/home/michael/prj/php-5.2.4]tail config.log #line 59860 "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; } The library is found, but as it is 64-bit, the routines are not found. Even with AIX I must specify -X64 to see the contents.... michael@x054:[/usr/local/lib/mysql]ls libdbug.a libmysqlclient_r.so libmysql.imp libmysqlclient_r.so.15 libmysqlclient.a libmysqlclient_r.so.15.0.0 libmysqlclient.so libmystrings.a libmysqlclient.so.15 libmysys.a libmysqlclient.so.15.0.0 libz.a libmysqlclient_r.a michael@x054:[/usr/local/lib/mysql]ar -t libmysqlclient.a michael@x054:[/usr/local/lib/mysql]ar -X64 -t libmysqlclient.a | head -5 libmysql.o password.o manager.o get_password.o errmsg.o My assumption is that php is not supporting 64-bit builds. I'll put a 32-bit mysql in place (as it is only a symbolic link I need to change) and continue. If php is linking functions into the client a 32-bit build should not be a problem. However, if it is loading the mysqlclient library dynamically, swictching to a 64-bit rte is likely to break php. p.s. I also downloaded and built the zlib-1.2.3 package. Having it installed was not enough, I still had to provide the source directory. Reproduce code: --------------- ./configure --with-mysql --with-zlib-dir=/data/prj/zlib.1.2.3 Expected result: ---------------- That I could run make. Actual result: -------------- checking for MySQL support... yes checking for specified location of the MySQL UNIX socket... no checking for MySQL UNIX socket location... /tmp/mysql.sock 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42926&edit=1

« previous php.bugs (#118406) next »