php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35400 PHP 5.0.5/ 5.1 compile fails when linked with mysql 5/ zlib
Submitted: 2005-11-25 22:53 UTC Modified: 2005-11-26 10:11 UTC
From: me at thomaskeller dot biz Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.1.0 OS: FC2, FC4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: me at thomaskeller dot biz
New email:
PHP Version: OS:

 

 [2005-11-25 22:53 UTC] me at thomaskeller dot biz
Description:
------------
Hi!

I'm trying to compile PHP5 (5.0.5 and 5.1.0) since several days on two different machines (one VPS Server with FC2 on Kernel 2.4, one FC4 machine with Kernel 2.6).

This is my configure command for the FC4 machine (only thing which changed in comparison to the FC2 configure is the path to apxs since this is installed somewhere different on FC2):

./configure --with-apxs2=/usr/sbin/apxs --disable-cgi --enable-bcmath --with-bz2 --enable-exif --with-gd --with-freetype-dir=/usr --enable-gd-native-ttf --with-mcrypt --enable-shmop --enable-soap --enable-sockets --without-sqlite --with-xmlrpc --with-pear=/usr/share/php --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr/lib/mysql --with-zlib-dir=/usr/lib 

The configure itself runs through, while the linkage fails with 

/bin/sh /data/download/php-5.1.0/libtool --silent --preserve-dup-deps --mode=link gcc -g -O2 -prefer-non-pic  -rpath /data/download/php-5.1.0/libs -avoid-version -module -L/usr/lib/mysql  -R /usr/lib/mysql ext/libxml/libxml.lo 
[... many more *.lo files ...]
main/internal_functions.lo -lcrypt -lcrypt -lmysqlclient -lmcrypt -lfreetype -lpng -lz -lbz2 -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lmysqlclient -lz -lcrypt -lnsl -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt  -o libphp5.la
grep: /usr/lib/mysql/libz.la: No such file or directory
/bin/sed: can't read /usr/lib/mysql/libz.la: No such file or directory
libtool: link: `/usr/lib/mysql/libz.la' is not a valid libtool archive
make: *** [libphp5.la] Fehler 1

Now, indeed there is no libz.la file in /usr/lib/mysql. These are the contents of it:

[root@tidikay php-5.1.0]# ll /usr/lib/mysql
insgesamt 6800
-rw-r--r--  1 root root   11068 17. Nov 01:17 libdbug.a
-rw-r--r--  1 root root   45274 17. Nov 01:17 libheap.a
-rw-r--r--  1 root root   57872 17. Nov 01:17 libmygcc.a
-rw-r--r--  1 root root  343028 17. Nov 01:17 libmyisam.a
-rw-r--r--  1 root root   26802 17. Nov 01:17 libmyisammrg.a
-rw-r--r--  1 root root 1457414 17. Nov 01:17 libmysqlclient.a
-rwxr-xr-x  1 root root     821 17. Nov 01:17 libmysqlclient.la
-rw-r--r--  1 root root 1465244 17. Nov 01:17 libmysqlclient_r.a
-rwxr-xr-x  1 root root     847 17. Nov 01:17 libmysqlclient_r.la
-rw-r--r--  1 root root 1211008 17. Nov 01:17 libmystrings.a
-rw-r--r--  1 root root  294132 17. Nov 01:17 libmysys.a
-rw-r--r--  1 root root 1339668 17. Nov 01:17 libndbclient.a
-rwxr-xr-x  1 root root    1043 17. Nov 00:16 libndbclient.la
-rw-r--r--  1 root root    6840 17. Nov 01:17 libvio.a
-rw-r--r--  1 root root  576131 17. Nov 01:17 mysqld.sym

As far as I know the libtool archive is created for a project if its build with automake, but the zlib sources aren't using automake at all. I tried to create my own libz.la based on "guessed" values, but that didn't seem to work.

I also tried to do the following things on php5's configure:

a) omit --with-zlib-dir completly -> configure told me it needs zlib for png
b) only use --with-zlib -> libtool error above
c) point --with-zlib-dir to /usr -> libtool error above
d) point --with-zlib-dir to the downloaded and extracted sources of zlib-1.2.3 -> libtool error above

I need to state that I have both, zlib and zlib-devel installed on both systems, as well as the MySQL 5.0.16 packages -devel, -shared-compat, -client and -server.

So *what* is needed to get this baby compiled properly with zlib, png mysql and mysqli?



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-26 02:34 UTC] sniper@php.net
Why are you using the wrong paths in your configure line?
For example /usr/lib/mysql is totally wrong. It should be just /usr and /usr/lib should be just /usr too..

No bug here.
 [2005-11-26 03:56 UTC] me at thomaskeller dot biz
I tried the following configures additionally (of course I did a make clean before each):

./configure --with-apxs2=/usr/sbin/apxs --disable-cgi --enable-bcmath --with-bz2 --enable-exif --with-gd --with-freetype-dir=/usr --enable-gd-native-ttf --with-mcrypt --enable-shmop --enable-soap --enable-sockets --without-sqlite --with-xmlrpc --with-pear=/usr/share/php --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr --with-zlib-dir=/usr --with-pdo-mysql

./configure --with-apxs2=/usr/sbin/apxs --disable-cgi --enable-bcmath --with-bz2 --enable-exif --with-gd --with-freetype-dir=/usr --enable-gd-native-ttf --with-mcrypt --enable-shmop --enable-soap --enable-sockets --without-sqlite --with-xmlrpc --with-pear=/usr/share/php --with-mysqli=/usr/bin/mysql_config --with-mysql --with-zlib-dir --with-pdo-mysql

Both bring the same error. Btw... libmysqlclient_r.la in /usr/lib/mysql contains the following:

root@tidikay php-5.1.0]# cat /usr/lib/mysql/libmysqlclient_r.la
# libmysqlclient_r.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.95 2004/04/11 05:50:42)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname=''

# Names of this library.
library_names=''

# The name of the static archive.
old_library='libmysqlclient_r.a'

# Libraries that this one depends upon.
dependency_libs=' -lpthread -lpthread /usr/lib/mysql/libz.la -lpthread -lcrypt -lnsl -lm -lpthread'
#                                    ^^^^^ I did _not_ put that in...

# Version information for libmysqlclient_r.
current=15
age=0
revision=0

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/lib/mysql'

This file is, as I already told you, part of the MySQL-devel rpm:

[root@tidikay php-5.1.0]# rpm -ql MySQL-devel
/usr/bin/comp_err
/usr/bin/mysql_config
/usr/include/mysql
/usr/include/mysql/chardefs.h
/usr/include/mysql/errmsg.h
/usr/include/mysql/history.h
/usr/include/mysql/keycache.h
/usr/include/mysql/keymaps.h
/usr/include/mysql/m_ctype.h
/usr/include/mysql/m_string.h
/usr/include/mysql/my_alloc.h
/usr/include/mysql/my_config.h
/usr/include/mysql/my_dbug.h
/usr/include/mysql/my_dir.h
/usr/include/mysql/my_getopt.h
/usr/include/mysql/my_global.h
/usr/include/mysql/my_list.h
/usr/include/mysql/my_net.h
/usr/include/mysql/my_no_pthread.h
/usr/include/mysql/my_pthread.h
/usr/include/mysql/my_semaphore.h
/usr/include/mysql/my_sys.h
/usr/include/mysql/my_xml.h
/usr/include/mysql/mysql.h
/usr/include/mysql/mysql_com.h
/usr/include/mysql/mysql_embed.h
/usr/include/mysql/mysql_time.h
/usr/include/mysql/mysql_version.h
/usr/include/mysql/mysqld_ername.h
/usr/include/mysql/mysqld_error.h
/usr/include/mysql/ndb
/usr/include/mysql/ndb/mgmapi
/usr/include/mysql/ndb/mgmapi/mgmapi.h
/usr/include/mysql/ndb/mgmapi/mgmapi_config_parameters.h
/usr/include/mysql/ndb/mgmapi/mgmapi_config_parameters_debug.h
/usr/include/mysql/ndb/mgmapi/mgmapi_debug.h
/usr/include/mysql/ndb/mgmapi/ndb_logevent.h
/usr/include/mysql/ndb/mgmapi/ndbd_exit_codes.h
/usr/include/mysql/ndb/ndb_constants.h
/usr/include/mysql/ndb/ndb_init.h
/usr/include/mysql/ndb/ndb_types.h
/usr/include/mysql/ndb/ndb_version.h
/usr/include/mysql/ndb/ndbapi
/usr/include/mysql/ndb/ndbapi/Ndb.hpp
/usr/include/mysql/ndb/ndbapi/NdbApi.hpp
/usr/include/mysql/ndb/ndbapi/NdbBlob.hpp
/usr/include/mysql/ndb/ndbapi/NdbDictionary.hpp
/usr/include/mysql/ndb/ndbapi/NdbError.hpp
/usr/include/mysql/ndb/ndbapi/NdbEventOperation.hpp
/usr/include/mysql/ndb/ndbapi/NdbIndexOperation.hpp
/usr/include/mysql/ndb/ndbapi/NdbIndexScanOperation.hpp
/usr/include/mysql/ndb/ndbapi/NdbOperation.hpp
/usr/include/mysql/ndb/ndbapi/NdbPool.hpp
/usr/include/mysql/ndb/ndbapi/NdbRecAttr.hpp
/usr/include/mysql/ndb/ndbapi/NdbReceiver.hpp
/usr/include/mysql/ndb/ndbapi/NdbScanFilter.hpp
/usr/include/mysql/ndb/ndbapi/NdbScanOperation.hpp
/usr/include/mysql/ndb/ndbapi/NdbTransaction.hpp
/usr/include/mysql/ndb/ndbapi/ndb_cluster_connection.hpp
/usr/include/mysql/ndb/ndbapi/ndb_opt_defaults.h
/usr/include/mysql/ndb/ndbapi/ndbapi_limits.h
/usr/include/mysql/ndb/ndbapi/ndberror.h
/usr/include/mysql/raid.h
/usr/include/mysql/readline.h
/usr/include/mysql/rlmbutil.h
/usr/include/mysql/rlprivate.h
/usr/include/mysql/rlshell.h
/usr/include/mysql/rltypedefs.h
/usr/include/mysql/sql_common.h
/usr/include/mysql/sql_state.h
/usr/include/mysql/sslopt-case.h
/usr/include/mysql/sslopt-longopts.h
/usr/include/mysql/sslopt-vars.h
/usr/include/mysql/tilde.h
/usr/include/mysql/typelib.h
/usr/include/mysql/xmalloc.h
/usr/lib/mysql
/usr/lib/mysql/libdbug.a
/usr/lib/mysql/libheap.a
/usr/lib/mysql/libmygcc.a
/usr/lib/mysql/libmyisam.a
/usr/lib/mysql/libmyisammrg.a
/usr/lib/mysql/libmysqlclient.a
/usr/lib/mysql/libmysqlclient.la
/usr/lib/mysql/libmysqlclient_r.a
/usr/lib/mysql/libmysqlclient_r.la
/usr/lib/mysql/libmystrings.a
/usr/lib/mysql/libmysys.a
/usr/lib/mysql/libndbclient.a
/usr/lib/mysql/libndbclient.la
/usr/lib/mysql/libvio.a
/usr/share/doc/MySQL-devel-5.0.16
/usr/share/doc/MySQL-devel-5.0.16/EXCEPTIONS-CLIENT
/usr/share/man/man1/mysql_config.1.gz


Now, I don't know enough of compile internals at all, especially not about what happens on linker time (is the libz.la created dynamically from libz.so?) and I don't know if this is a MySQL or PHP problem therefor, but I also tried to remove that part off the libmysqlclient_r.la with no success.

Any ideas?

Thanks for your ongoing support.
Thomas.b
 [2005-11-26 04:01 UTC] me at thomaskeller dot biz
Sorry, the 2nd configure was of course:

./configure --with-apxs2=/usr/sbin/apxs --disable-cgi --enable-bcmath
--with-bz2 --enable-exif --with-gd --with-freetype-dir=/usr
--enable-gd-native-ttf --with-mcrypt --enable-shmop --enable-soap
--enable-sockets --without-sqlite --with-xmlrpc
--with-pear=/usr/share/php --with-mysqli=/usr/bin/mysql_config
--with-mysql --with-zlib --with-pdo-mysql
 [2005-11-26 06:28 UTC] me at thomaskeller dot biz
It was indeed a problem with mysql's -devel package version 5.0.16, a downgrade to 5.0.15 fixed the problem. Also, I needed to set a missing symlink on my system as follows:

ln -s /usr/lib/libltdl.so.3 /usr/lib/libltdl.so  

to overrun another libtool problem.

Sorry for wasting your time =)
 [2005-11-26 10:11 UTC] tony2001@php.net
No PHP bug -> bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 11:01:33 2024 UTC