Bug #76345 [Com]: fatal error: zip.h: No such file or directory
| From: | maroszek at gmx dot net | Date: | Sun, 26 May 2019 09:32:26 +0000 |
| Subject: | Bug #76345 [Com]: fatal error: zip.h: No such file or directory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220996@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76345&edit=1
ID: 76345
Comment by: maroszek at gmx dot net
Reported by: tholforty at gmail dot com
Summary: fatal error: zip.h: No such file or directory
Status: Open
Type: Bug
Package: Compile Failure
Operating System: CentOS 7.4
PHP Version: 7.2.5
Block user comment: N
Private report: N
New Comment:
I can reproduce this issue. I used this minimal patch to fix the issue.
--- php-7.3.5-src/ext/zip/config.m4 2019-04-30 10:37:24.000000000 +0200
+++ php-7.3.5-patched/ext/zip/config.m4 2019-05-26 11:09:15.000000000 +0200
@@ -116,6 +116,7 @@
])
AC_DEFINE(HAVE_ZIP,1,[ ])
+ PHP_EVAL_INCLINE($LIBZIP_CFLAGS)
PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared,, $LIBZIP_CFLAGS)
PHP_SUBST(ZIP_SHARED_LIBADD)
else
I added PRs for master and PHP 7.3.
https://github.com/php/php-src/pull/4190
(master)
https://github.com/php/php-src/pull/4191
(7.3)
Previous Comments:
------------------------------------------------------------------------
[2019-03-18 05:05:25] mnikulin at plesk dot com
The issue may be worse if incompatible zip.h presents in search path,
e.g. old version installed as a system package to /usr/include.
Different alignment of structure fields might potentially lead
to crashes. Fortunately it seems that no declarations from
zip.h is used outside of ext/zip.
The patch attached earlier looks malformed.
In my opinion zip.h belongs to implementation details, so should not
be used outside of ext/zip, so php_zip.h should be split into
public and internal parts.
Minimal workaround without modification of php_zip.h is
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -1525,8 +1525,8 @@ PHP_ADD_SOURCES(main/streams, streams.c
plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c \
glob_wrapper.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
-PHP_ADD_SOURCES(/main, internal_functions.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, sapi)
-PHP_ADD_SOURCES_X(/main, internal_functions_cli.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,
PHP_BINARY_OBJS)
+PHP_ADD_SOURCES(/main, internal_functions.c, [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $LIBZIP_CFLAGS],
sapi)
+PHP_ADD_SOURCES_X(/main, internal_functions_cli.c, [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1
$LIBZIP_CFLAGS], PHP_BINARY_OBJS)
PHP_ADD_SOURCES(Zend, \
zend_language_parser.c zend_language_scanner.c \
------------------------------------------------------------------------
[2019-01-30 13:36:58] tholforty at gmail dot com
the patch provided should fix it. it is patching ext/zip/libzip_config.m4.
it is simply adding PHP_ADD_INCLUDE macro in a couple places to make sure the compiler looks in the
custom specified place first.
------------------------------------------------------------------------
[2019-01-30 02:39:15] han at 163 dot com
Me too. What should I do?
------------------------------------------------------------------------
[2018-06-14 08:00:47] imoco at qq dot com
me too,my php version:7.2.6 os:centos 7.5
------------------------------------------------------------------------
[2018-05-16 07:08:37] tholforty at gmail dot com
Changed to compile failure, since it is not an issue with PECL:Zip
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=76345
--
Edit this bug report at https://bugs.php.net/bug.php?id=76345&edit=1