Bug #81613 [Opn]: impossible to compile php with zip support

From: Date: Fri, 12 Nov 2021 09:52:39 +0000
Subject: Bug #81613 [Opn]: impossible to compile php with zip support
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237711@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81613&edit=1

 ID:                 81613
 Updated by:         nikic@php.net
 Reported by:        mtbox74 at gmail dot com
 Summary:            impossible to compile php with zip support
 Status:             Open
 Type:               Bug
 Package:            Compile Failure
 Operating System:   Xubuntu 18.04
 PHP Version:        7.4.25
-Assigned To:        
+Assigned To:        remi
 Block user comment: N
 Private report:     N

 New Comment:

At a guess, this happens because pdo_pgsql explicitly adds a system libdir via
-L/usr/lib/x86_64-linux-gnu before the custom libdir for libzip -L/usr/local/libzip/1_5_2/lib. This
happens because "pq_config --libdir" is used. "pkg-config --libs libpq" would
return the correct result of "-lpq" only.

Assigning this to remi because he objected to the pkg-config migration last time, due to lack of
support on some old distros. Has enough time passed that we can migrate libpq detection to
pkg-config now?


Previous Comments:
------------------------------------------------------------------------
[2021-11-12 00:21:46] mtbox74 at gmail dot com

Description:
------------
I'm getting this error when combining --with-zlib --with-zip --with-pdo-pgsql. It says:

ext/zip/.libs/php_zip.o: In function `c_ziparchive_setEncryptionName':
/trusty/Downloads/php-7.4.25/ext/zip/php_zip.c:2254: undefined reference to
`zip_file_set_encryption'
ext/zip/.libs/php_zip.o: In function `c_ziparchive_setEncryptionIndex':
/trusty/Downloads/php-7.4.25/ext/zip/php_zip.c:2278: undefined reference to
`zip_file_set_encryption'
ext/zip/.libs/php_zip.o: In function `zm_startup_zip':
/trusty/Downloads/php-7.4.25/ext/zip/php_zip.c:3199: undefined reference to
`zip_libzip_version'
ext/zip/.libs/php_zip.o: In function `zm_info_zip':
/trusty/Downloads/php-7.4.25/ext/zip/php_zip.c:3233: undefined reference to
`zip_libzip_version'
collect2: error: ld returned 1 exit status
Makefile:293: recipe for target 'sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1


If I remove --with-pdo-pgsql no errors appears.
I've installed manually zlib 1.5.2 to use encryptions methods provided by zip.
I can compile with pdo-mysql but not with pdo-pgsql :(

I got the same error compiling against latest version of php7.3 & PHP8.0
The workaround I found is to compile zip as a dynamic extension.

Full Trace: https://gist.github.com/nordin74/e56b02c12ca2f1483bee988ea6f73bf5


Test script:
---------------
./configure  \
--prefix=/home/will/php_7.4_fpm  \
--with-curl  \
--with-xsl  \
--with-pdo-mysql  \
--enable-soap  \
--enable-mbstring  \
--enable-bcmath  \
--enable-sockets  \
--enable-calendar  \
--enable-exif  \
--enable-ftp  \
--with-openssl  \
--enable-sysvmsg  \
--enable-sysvsem  \
--enable-sysvshm  \
--with-bz2=/usr  \
--with-gettext  \
--enable-gd  \
--with-freetype  \
--with-mysqli  \
--with-readline  \
--with-zlib  \
--with-zip  \
--enable-fpm  \
--enable-opcache  \
--with-jpeg  \
--enable-intl  \
--enable-pcntl  \
--enable-maintainer-zts  \
--with-pdo-pgsql

Expected result:
----------------
compile without error

Actual result:
--------------
error


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81613&edit=1


Thread (5 messages)

« previous php.bugs (#237711) next »