php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21151 zlib and pcre as external modules don't work
Submitted: 2002-12-22 19:18 UTC Modified: 2003-02-09 13:14 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: oden dot eriksson at linux-mandrake dot com Assigned:
Status: Closed Package: Dynamic loading
PHP Version: 4.3.0RC4 OS: Mandrake 9.0
Private report: No CVE-ID: None
 [2002-12-22 19:18 UTC] oden dot eriksson at linux-mandrake dot com
Hi.

zlib and pcre won't build as external modules. Here's my configure line:


./configure \
    --prefix=/usr \
    --exec-prefix=/usr \
    --bindir=/usr/bin \
    --sbindir=/usr/sbin \
    --datadir=/usr/share \
    --sysconfdir=/etc \
    --libdir=/usr/lib \
    --includedir=/usr/include \
    --infodir=/usr/share/info \
    --mandir=/usr/share/man \
    --with-apxs2=/usr/sbin/apxs \
    --enable-force-cgi-redirect \
    --enable-discard-path \
    --enable-debug \
    --with-layout=GNU \
    --with-config-file-path=/etc \
    --with-config-file-scan-dir=/etc/httpd/conf.d \
    --with-pear=/usr/lib/php \
    --enable-safe-mode \
    --with-exec-dir=/usr/bin \
    --enable-magic-quotes \
    --disable-rpath \
    --with-openssl=shared,/usr --with-zlib=shared,/usr --with-zlib-dir=/usr \
    --enable-bcmath=shared \
    --with-bz2=shared,/usr \
    --enable-calendar=shared \
    --without-cpdflib \
    --with-jpeg-dir=/usr \
    --with-tiff-dir=/usr \
    --without-crack \
    --with-ctype=shared \
    --with-curl=shared,/usr \
    --without-cyrus \
    --without-db \
    --enable-dba=shared,/usr \
    --with-gdbm=shared,/usr \
    --without-ndbm \
    --without-db2 \
    --without-db3 \
    --with-db4=shared,/usr \
    --without-dbm \
    --with-cdb=shared,/usr \
    --with-flatfile=shared \
    --enable-dbase=shared \
    --enable-dbx=shared,/usr \
    --enable-dio=shared,/usr \
    --with-dom=shared,/usr --with-zlib-dir=/usr --with-dom-xslt=shared,/usr --with-dom-exslt=shared,/usr \
    --enable-exif=shared \
    --without-fbsql \
    --without-fdftk \
    --enable-filepro=shared \
    --without-fribidi \
    --enable-ftp=shared \
    --with-gd=shared --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xpm-dir=/usr/X11R6/lib/ \
    --with-ttf=/usr \
    --with-freetype-dir=/usr \
    --with-t1lib=/usr \
    --enable-gd-native-ttf \
    --with-gettext=shared,/usr \
    --with-gmp=shared,/usr \
    --without-hwapi \
    --without-hyperwave \
    --without-iconv \
    --with-imap=shared,/usr \
    --without-kerberos \
    --with-imap-ssl=shared,/usr \
    --without-informix \
    --without-ingres \
    --without-interbase \
    --without-ircg \
    --with-ircg-config=/dev/null \
    --without-java \
    --with-ldap=shared,/usr \
    --enable-mbstring=shared \
    --enable-mbregex=shared \
    --without-mcal \
    --with-mcrypt=shared,/usr \
    --without-mcve \
    --with-mhash=shared,/usr \
    --enable-mime-magic=shared \
    --with-ming=shared,/usr \
    --with-mnogosearch=shared,/usr \
    --without-msession \
    --without-msql \
    --without-mssql \
    --with-mysql=shared,/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-zlib-dir=/usr \
    --with-ncurses=shared,/usr \
    --without-oci8 \
    --without-adabas \
    --without-sapdb \
    --without-solid \
    --without-ibm-db2 \
    --without-empress \
    --without-empress-bcs \
    --without-birdstep \
    --without-custom-odbc \
    --without-iodbc \
    --without-esoob \
    --with-unixODBC=shared,/usr \
    --without-openlink \
    --without-dbmaker \
    --without-oracle \
    --enable-overload=shared \
    --without-ovrimos \
    --disable-pcntl \
    --without-pcre-regex \
    --with-pcre-regex=shared,/usr \
    --without-pdflib --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-tiff-dir=/usr \
    --without-pfpro \
    --with-pgsql=shared,/usr \
    --enable-posix=shared \
    --with-pspell=shared,/usr \
    --without-qtdom \
    --without-libedit \
    --without-readline \
    --with-recode=shared,/usr \
    --enable-session=shared \
    --without-mm \
    --enable-shmop=shared \
    --with-snmp=shared,/usr \
    --enable-ucd-snmp-hack \
    --enable-sockets=shared \
    --with-regex=php \
    --without-swf \
    --without-sybase \
    --with-sybase-ct=shared,/usr \
    --enable-sysvmsg=shared \
    --enable-sysvsem=shared \
    --enable-sysvshm=shared \
    --enable-tokenizer=shared \
    --enable-wddx=shared \
    --disable-xml \
    --with-expat-dir=shared,/usr \
    --with-xmlrpc=shared,/usr \
    --with-expat-dir=shared,/usr \
    --without-iconv-dir \
    --enable-xslt=shared,/usr \
    --with-xslt-sablot=shared,/usr \
    --with-expat-dir=shared,/usr \
    --without-iconv-dir \
    --with-sablot-js=shared,/usr \
    --without-yaz \
    --enable-yp=shared \
    --with-zip=shared,/usr \
    --enable-shared \
    --with-pic \
    --enable-inline-optimization \
    --enable-memory-limit


gcc -O6 -fomit-frame-pointer -pipe -s -mcpu=i686 -march=i686 -ffast-math -fexpensive-optimizations -fPIC -g -Wall ext/ctype/ctype.lo ext/standard/array.lo ext/standard/base64.lo ext/standard/basic_functions.lo ext/standard/browscap.lo ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo ext/standard/filestat.lo ext/standard/flock_compat.lo ext/standard/formatted_print.lo ext/standard/fsock.lo ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo ext/standard/versioning.lo ext/standard/assert.lo ext/standard/strnatcmp.lo ext/standard/levenshtein.lo ext/standard/incomplete_class.lo ext/standard/url_scanner_ex.lo ext/standard/ftp_fopen_wrapper.lo ext/standard/http_fopen_wrapper.lo ext/standard/php_fopen_wrapper.lo ext/standard/credits.lo ext/standard/css.lo ext/standard/var_unserializer.lo ext/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo regex/regcomp.lo regex/regexec.lo regex/regerror.lo regex/regfree.lo TSRM/TSRM.lo TSRM/tsrm_strtok_r.lo TSRM/tsrm_virtual_cwd.lo main/main.lo main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo main/fopen_wrappers.lo main/alloca.lo main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_types.lo main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo main/php_variables.lo main/php_ticks.lo main/streams.lo main/network.lo main/php_open_temporary_file.lo main/php_logos.lo main/output.lo main/memory_streams.lo main/user_streams.lo Zend/zend_language_parser.lo Zend/zend_language_scanner.lo Zend/zend_ini_parser.lo Zend/zend_ini_scanner.lo Zend/zend_alloc.lo Zend/zend_compile.lo Zend/zend_constants.lo Zend/zend_dynamic_array.lo Zend/zend_execute_API.lo Zend/zend_highlight.lo Zend/zend_llist.lo Zend/zend_opcode.lo Zend/zend_operators.lo Zend/zend_ptr_stack.lo Zend/zend_stack.lo Zend/zend_variables.lo Zend/zend.lo Zend/zend_API.lo Zend/zend_extensions.lo Zend/zend_hash.lo Zend/zend_list.lo Zend/zend_indent.lo Zend/zend_builtin_functions.lo Zend/zend_sprintf.lo Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -o sapi/cli/php -Wl,--export-dynamic  -lm -lcrypt -lpam -lcrypt -lssl -lcrypto -lresolv -lm -ldl -lnsl -lcrypt
ext/standard/image.lo: In function `php_handle_swc':
/home/root/webserver/php-4.3.0RC4/ext/standard/image.c:195: undefined reference to `uncompress'
/home/root/webserver/php-4.3.0RC4/ext/standard/image.c:217: undefined reference to `uncompress'
ext/standard/aggregation.lo: In function `aggregate_methods':
/home/root/webserver/php-4.3.0RC4/ext/standard/aggregation.c:129: undefined reference to `pcre_exec'
/home/root/webserver/php-4.3.0RC4/ext/standard/aggregation.c:94: undefined reference to `pcre_get_compiled_regex'
ext/standard/aggregation.lo: In function `aggregate_properties':
/home/root/webserver/php-4.3.0RC4/ext/standard/aggregation.c:242: undefined reference to `pcre_exec'
/home/root/webserver/php-4.3.0RC4/ext/standard/aggregation.c:200: undefined reference to `pcre_get_compiled_regex'
main/SAPI.lo: In function `sapi_header_op':
/home/root/webserver/php-4.3.0RC4/main/SAPI.c:526: undefined reference to `zlib_globals'
main/SAPI.lo: In function `sapi_send_headers':
/home/root/webserver/php-4.3.0RC4/main/SAPI.c:675: undefined reference to `zlib_globals'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-23 02:53 UTC] derick@php.net
Too many modules rely on zlib and pcre, the best thing would be to disallow them to be compiled as shared module. For now: just don't do it :)

Derick
 [2003-01-03 02:26 UTC] jmdault at mandrakesoft dot com
Oden, you're a modularization maniac ;-)

Some extensions, like ftp, session, zlib and pcre should really remain in the PHP core, since:
1) they don't need extra libraries (try to install an RPM without libz.so ;-)
2) they are really small and don't add extra weigth to PHP
3) users need them and will complain if they're not installed by default (trust me on this one!)

Jean-Michel
 [2003-01-07 10:27 UTC] helmut at phpwebservices dot com
Confirmed same issue on Solaris 8 for version 4.3.0.  I do agree that zlib is not that large and can be compiled into php (hit after reading that suggestion!) but still the option is there and does not work...
 [2003-01-13 12:16 UTC] oden dot eriksson at linux-mandrake dot com
Jean-Michel

Yes I am ;)

But if these extensions can't be built as a loadable dso, you shouldn't be able to use "=shared". This is really extreme stuff and I doubt people would use this configure line.
 [2003-01-29 06:07 UTC] achowe at snert dot com
Between 4.2.3 and 4.3.0 (Mandrake 9.0) the ability to make zlib a shared module BROKE.

Regardless if this module is small or not, the option exists to make it a shared module for PHP.

It compiles fine, but it won't run:

[root@x1 apache]# apachectl start
Syntax error on line 62 of /etc/httpd/conf/httpd.conf:
Cannot load /etc/httpd/lib/apache/libphp4.so into server: /etc/httpd/lib/apache/libphp4.so: undefined symbol: zlib_globals
/usr/sbin/apachectl start: httpd could not be started
[root@x1 apache]#

Our configure script:

./configure \
--prefix=/usr/local \
--libexecdir=/usr/lib/apache \
--with-config-file-path=/usr/local/lib/php:/usr/local/lib:/etc \
--enable-discard-path \
--enable-bcmath=shared \
--enable-exif=shared \
--enable-ftp=shared \
--enable-sockets=shared \
--enable-track-vars \
--with-apxs \
--with-bz2=shared \
--with-gettext \
--with-xml=shared \
--with-gd=shared,/usr/local \
--with-freetype-dir=shared,/usr/local \
--with-jpeg-dir=shared \
--with-png-dir=shared \
--with-ldap=shared \
--with-pcre-regex=shared \
--with-zlib=shared,/usr \
--with-openssl=shared \
--with-pgsql=shared \
--with-mysql=shared,/usr \
--with-mnogosearch=shared,/usr/local/mnogosearch \
--with-snmp=shared \
--disable-ctype \
--without-aspell \
--without-db2 \
--without-db3 \
--without-pear
 [2003-02-09 10:32 UTC] moriyoshi@php.net
Just FYI: See bug #22131
 [2003-02-09 12:22 UTC] sniper@php.net
#22131 has nothing to do with this issue..

 [2003-02-09 13:14 UTC] sniper@php.net
These compile failures are now fixed in CVS.
But compiling zlib/pcre as shared is not really
useful..you lose some functionality they provide.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC