Would like to add the gd zip extension to php, done the phpize ./configure make make install routine, still can't find gd zip. Any idea ?
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/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... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -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/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20121212
checking for PHP installed headers prefix... /usr/local/include/php
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... no
checking for nawk... nawk
checking if nawk is broken... no
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 ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc 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
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # make
/bin/bash /root/DOWNLOADS/php-5.5.23/ext/zip/libtool --mode=install cp ./zip.la /root/DOWNLOADS/php-5.5.23/ext/zip/modules
cp ./.libs/zip.so /root/DOWNLOADS/php-5.5.23/ext/zip/modules/zip.so
cp ./.libs/zip.lai /root/DOWNLOADS/php-5.5.23/ext/zip/modules/zip.la
PATH="$PATH:/sbin" ldconfig -n /root/DOWNLOADS/php-5.5.23/ext/zip/modules
----------------------------------------------------------------------
Libraries have been installed in:
/root/DOWNLOADS/php-5.5.23/ext/zip/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # make install
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20121212/
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip #
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # php -m
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'gd.so' in Unknown on line 0
Warning: PHP Startup: Invalid library (maybe not a PHP library) 'gd.so' in Unknown on line 0
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0
Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zlib.so' in Unknown on line 0
Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zlib.so' in Unknown on line 0
[PHP Modules]
Core
ctype
date
dom
ereg
fileinfo
filter
gd
hash
iconv
json
libxml
pcre
PDO
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
[Zend Modules]
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip #
And here's the result of make test
(all tests skipped and same warnings printed on top)
root@audio-mon[10.10.10.82] ~/DOWNLOADS/php-5.5.23/ext/zip # make test
Build complete.
Don't forget to run 'make test'.
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0
=====================================================================
PHP : /usr/local/bin/php
Warning: PHP Startup: Invalid library (maybe not a PHP library) 'zip.so' in Unknown on line 0
PHP_SAPI : cli
PHP_VERSION : 5.5.23
ZEND_VERSION: 2.5.0
PHP_OS : Linux - Linux audio-mon 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64
INI actual : /root/DOWNLOADS/php-5.5.23/ext/zip/tmp-php.ini
More .INIs :
CWD : /root/DOWNLOADS/php-5.5.23/ext/zip
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2015-10-27 09:11:32
=====================================================================
SKIP Check for zip presence [tests/001.phpt]
SKIP Bug #11216 (::addEmptyDir() crashes when the directory already exists) [tests/bug11216.phpt]
SKIP Bug #14962 (::extractTo second argument is not really optional) [tests/bug14962.phpt]
SKIP #38943, properties in extended class cannot be set (5.3+) [tests/bug38943.phpt]
SKIP Bug #38944 (newly created ZipArchive segfaults when accessing comment property) [tests/bug38944.phpt]
SKIP Bug #40228 (extractTo does not create recursive empty path) [tests/bug40228.phpt]
SKIP Bug #47667 (ZipArchive::OVERWRITE seems to have no effect) [tests/bug47667.phpt]
SKIP Bug #49072 (feof never returns true for damaged file in zip) [tests/bug49072.phpt]
SKIP Bug #51353 ZIP64 problem, archive with 100000 items [tests/bug51353.phpt]
SKIP Bug #53579 (stream_get_contents() segfaults on ziparchive streams) [tests/bug53579.phpt]
SKIP Bug #53603 (ZipArchive should quiet stat errors) [tests/bug53603.phpt]
SKIP Bug #53854 (Missing constants for compression type) [tests/bug53854.phpt]
SKIP Bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive) [tests/bug53885.phpt]
SKIP Bug #64342 ZipArchive::addFile() has to check file existence (variation 1) [tests/bug64342_0.phpt]
SKIP Bug #64342 ZipArchive::addFile() has to check file existence (variation 2) [tests/bug64342_1.phpt]
SKIP Bug #7214 (zip_entry_read() binary safe) [tests/bug7214.phpt]
SKIP Bug #7658 (modify archive with general bit flag 3 set) [tests/bug7658.phpt]
SKIP Bug #8009 (cannot add again same entry to an archive) [tests/bug8009.phpt]
SKIP Bug #8700 (getFromIndex(0) fails) [tests/bug8700.phpt]
SKIP ziparchive::addEmptyDir [tests/oo_addemptydir.phpt]
SKIP ziparchive::addFile() function [tests/oo_addfile.phpt]
SKIP zip::close() function [tests/oo_close.phpt]
SKIP Delete entries [tests/oo_delete.phpt]
SKIP Extending Zip class and array property [tests/oo_ext_zip.phpt]
SKIP extractTo [tests/oo_extract.phpt]
SKIP getComment [tests/oo_getcomment.phpt]
SKIP getNameIndex [tests/oo_getnameindex.phpt]
SKIP This test will test getStatusString method in ZipArchive [tests/oo_getstatusstring.phpt] reason: extension not available
SKIP Locate entries by name [tests/oo_namelocate.phpt]
SKIP zip::open() function [tests/oo_open.phpt]
SKIP ziparchive::properties isset()/empty() checks [tests/oo_properties.phpt]
SKIP Rename entries [tests/oo_rename.phpt]
SKIP setComment [tests/oo_setcomment.phpt]
SKIP getStream [tests/oo_stream.phpt]
SKIP Bug #12414 ( extracting files from damaged archives) [tests/pecl12414.phpt]
SKIP stream_get_meta_data() on zip stream [tests/stream_meta_data.phpt]
SKIP zip_close() function [tests/zip_close.phpt]
SKIP zip_entry_compressedsize() function [tests/zip_entry_compressedsize.phpt]
SKIP zip_entry_compressionmethod() function [tests/zip_entry_compressionmethod.phpt]
SKIP zip_entry_filesize() function [tests/zip_entry_filesize.phpt]
SKIP zip_entry_name() function [tests/zip_entry_name.phpt]
SKIP zip_entry_open() function [tests/zip_entry_open.phpt]
SKIP zip_entry_read() function [tests/zip_entry_read.phpt]
SKIP zip_open() function [tests/zip_open.phpt]
SKIP zip_open() error conditions [tests/zip_open_error.phpt]
SKIP zip_read() function [tests/zip_read.phpt]
=====================================================================
TIME END 2015-10-27 09:11:33
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 27
---------------------------------------------------------------------
Number of tests : 46 0
Tests skipped : 46 (100.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 1 seconds
=====================================================================
Not sure what caused this, but make clean
then restarting phpize && ./configure && make && make install solved this sort of problem.
The question is already closed, but I think I had the very same problem.
The case was that I compiled pdo, mysql, mysqli as extensions, but they was already built in (Just as the zip extension in the original case). The only thing I needed to do is to remove the extension=pdo.so from the config.
After issuing php -i it showed the pdo and mysqli support, BUT the error is gone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With