|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-02-29 16:32 UTC] danval at gmail dot com
Description:
------------
Installation warning error when compiling php 5
Reproduce code:
---------------
configuration used with compiled extensions
./configure \
--prefix=/Apache/php \
--with-libxml-dir=/Apache/local/libxml \
--with-zlib-dir=/Apache/local/zlib \
--with-zlib \
--with-curl=/Apache/local/curl \
--with-jpeg-dir=/Apache/local/gd \
--with-png-dir=/Apache/local/gd \
--with-gd \
--with-mcrypt=/Apache/local/mcrypt \
--with-mhash=/Apache/local/mhash \
--with-mysql=/usr/local/mysql \
--with-mysql-sock=/usr/local/mysql/run \
--with-apxs2=/Apache/bin/apxs \
--enable-soap \
--enable-sockets \
--enable-shared \
--enable-cli \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-mbregex \
--enable-xmlreader
Expected result:
----------------
successful sudo make
Actual result:
--------------
Last few lines after 'sudo make'
sapi/apache2handler/apache_config.o sapi/apache2handler/php_functions.o main/internal_functions.o -lmysqlclient -lmhash -lmcrypt -lltdl -liconv -lpng -lz -ljpeg -lcurl -lz -lm -lxml2 -lz -liconv -lm -lcurl -lssl -lcrypto -lldap -lz -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -o libs/libphp5.bundle && cp libs/libphp5.bundle libs/libphp5.so
Undefined symbols:
"_xmlTextReaderSchemaValidate", referenced from:
_zim_xmlreader_setSchema in php_xmlreader.o
"_xmlTextReaderSetup", referenced from:
_zim_xmlreader_XML in php_xmlreader.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
Issue still exists in 5.x trunk from SVN. The solution is simple: in the Makefile, on the line where "libs/libphp$(PHP_MAJOR_VERSION).bundle:" appears, the $(MH_BUNDLE_FLAGS) variable should be called after "$(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS)" so that the hard-coded "/usr/lib" search path is searched after any user-provided search paths given during configure. For example, the Makefile currently contains this passage: "MH_BUNDLE_FLAGS = -bundle -bundle_loader /usr/sbin/httpd -L/usr/lib -L/usr/lib -laprutil-1 -lsqlite3 -lexpat -liconv -L/usr/lib -lapr-1 -lpthread" ...which sets library search paths as '/usr/lib'. Further below: "libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so" ...demonstrates that the '-L/usr/lib' from $MH_BUNDLE_FLAGS is given priority and will be searched before the '-L/custom/paths' contained in the variables immediately following it. This is likely not the intended behaviour, since it circumvents the user's intentions when passing library search paths to the configure script. What should be found in the Makefile—which will resolve this issue—is the following: "libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(CC) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(MH_BUNDLE_FLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so" Can anyone with autotools and PHP build process familiarity comment on any possible repercussions from this minor and logical change?