php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61535 zip fails to compile on php 5.2.X on ubuntu 10.04
Submitted: 2012-03-28 00:13 UTC Modified: 2013-10-23 08:01 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: michaeln at associationsplus dot ca Assigned:
Status: Not a bug Package: zip (PECL)
PHP Version: Irrelevant OS: ubuntu 10.04
Private report: No CVE-ID: None
 [2012-03-28 00:13 UTC] michaeln at associationsplus dot ca
Description:
------------
I am running Ubuntu 10.04 but running PHP 5.2.X because we are running a production server with tons of code that we do not have the resources to update, some of which requires register_globals, thus we cannot use PHP 5.3.X or higher.

If there is something I can do to install zip WITHOUT upgrading PHP (this is NOT a viable option or solution), please let me know and I will do that (i.e. installing an older version of zip).

At first I was unable to compile at all because it did not find /usr/bin/gcc-4.4 so I made a symbolic link /usr/bin/gcc that points to it.

However, compilation still failed.

Included is the entire compilation log:


running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
building in /tmp/pear/temp/pear-build-rootYf0nbF/zip-1.10.2
running: /tmp/pear/temp/zip/configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for icc... no
checking for suncc... no
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
checking for PHP extension directory... /usr/lib/php5/20060613
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for zip archive read/writesupport... yes, shared
checking for the location of libz... no
checking pcre install prefix... no
checking for the location of zlib... /usr
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootYf0nbF/zip-1.10.2/libtool --mode=compile gcc  -I. -I/tmp/pear/temp/zip -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootYf0nbF/zip-1.10.2/include -I/tmp/pear/temp/pear-build-rootYf0nbF/zip-1.10.2/main -I/tmp/pear/temp/zip -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/zip/php_zip.c -o php_zip.lo
libtool: compile:  gcc -I. -I/tmp/pear/temp/zip -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootYf0nbF/zip-1.10.2/include -I/tmp/pear/temp/pear-build-rootYf0nbF/zip-1.10.2/main -I/tmp/pear/temp/zip -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/zip/php_zip.c  -fPIC -DPIC -o .libs/php_zip.o
In file included from /tmp/pear/temp/zip/php_zip.c:30:
/usr/include/php5/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /tmp/pear/temp/zip/php_zip.c:30:
/usr/include/php5/ext/pcre/php_pcre.h:45: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
/usr/include/php5/ext/pcre/php_pcre.h:46: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
/usr/include/php5/ext/pcre/php_pcre.h:52: error: expected specifier-qualifier-list before âpcreâ
/tmp/pear/temp/zip/php_zip.c: In function âphp_zip_extract_fileâ:
/tmp/pear/temp/zip/php_zip.c:185: warning: passing argument 6 of âphp_basenameâ from incompatible pointer type
/usr/include/php5/ext/standard/php_string.h:126: note: expected âsize_t *â but argument is of type âunsigned int *â
/tmp/pear/temp/zip/php_zip.c: In function âphp_zip_pcreâ:
/tmp/pear/temp/zip/php_zip.c:601: error: âpcreâ undeclared (first use in this function)
/tmp/pear/temp/zip/php_zip.c:601: error: (Each undeclared identifier is reported only once
/tmp/pear/temp/zip/php_zip.c:601: error: for each function it appears in.)
/tmp/pear/temp/zip/php_zip.c:601: error: âreâ undeclared (first use in this function)
/tmp/pear/temp/zip/php_zip.c:602: error: âpcre_extraâ undeclared (first use in this function)
/tmp/pear/temp/zip/php_zip.c: At top level:
/tmp/pear/temp/zip/php_zip.c:1112: warning: initialization discards qualifiers from pointer target type
/tmp/pear/temp/zip/php_zip.c: In function âphp_zip_add_from_patternâ:
/tmp/pear/temp/zip/php_zip.c:1636: warning: passing argument 6 of âphp_basenameâ from incompatible pointer type
/usr/include/php5/ext/standard/php_string.h:126: note: expected âsize_t *â but argument is of type âunsigned int *â
/tmp/pear/temp/zip/php_zip.c: In function âzm_startup_zipâ:
/tmp/pear/temp/zip/php_zip.c:2586: warning: assignment discards qualifiers from pointer target type
make: *** [php_zip.lo] Error 1
ERROR: `make' failed


Test script:
---------------
pecl install zip

Expected result:
----------------
zip installs

Actual result:
--------------
compilation failed, zip did not install

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-28 00:17 UTC] michaeln at associationsplus dot ca
I found that I was able to compile an older version (i tried 1.7.5), please add some documentation which suggests which version to install with which version of PHP so this can be avoided in the future, since the PHP.net documentation currently refers people to PECL even if they have version PHP 4, yet PECL seems to not want to accept bugs for anything before version 5.3.
 [2012-03-28 00:20 UTC] michaeln at associationsplus dot ca
I guess I've solved my issue then. Thanks. Hopefully if anyone has this problem but isn't a linux master, they'll find this closed bug from a google search and answer their own question.

FYI - It seems that zip-1.8.10 also works, just not anything newer:

To anyone wondering how to install zip on an older version of php, you'd just do something like this on the command line if your pecl command is working properly:

pecl install zip-1.8.10
 [2013-10-23 08:01 UTC] remi@php.net
-Status: Open +Status: Not a bug
 [2013-10-23 08:01 UTC] remi@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Mar 28 21:01:22 2020 UTC