php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76345 fatal error: zip.h: No such file or directory
Submitted: 2018-05-15 21:57 UTC Modified: 2018-05-16 07:08 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: tholforty at gmail dot com Assigned:
Status: Open Package: Compile Failure
PHP Version: 7.2.5 OS: CentOS 7.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tholforty at gmail dot com
New email:
PHP Version: OS:

 

 [2018-05-15 21:57 UTC] tholforty at gmail dot com
Description:
------------
the config.m4 make config file is missing the PHP_ADD_INCLUDE() macro. This is an issue with all versions that include --with-libzip=DIR from v5.6 to v7.2

I'm building multiple php versions on the server and do not have any intention of working with the base yum installed version. As such I didn't install the libzip-devel package that puts headers (albeit old ones) into the system include. I compiled libzip into /opt/libzip and used --with-libzip=/opt/libzip for the php compile. That is how I ran into the issue.

As a control, php compiles just fine without the libtidy-devel package installed and specifying --with-tidy=/opt/libtidy.

With the setup in ext/zip/config.m4 as is, make will look for zip.h in the system /usr/include and not in the include of the directory specified in --with-libzip=DIR. Without a system level installation of zip.h, this error occurs during make:

In file included from main/internal_functions_cli.c:36:0:
/usr/local/src/git-php72-build/php-src/ext/zip/php_zip.h:31:17: fatal error: zip.h: No such file or directory
 #include <zip.h>
                 ^
compilation terminated.
make: *** [main/internal_functions_cli.lo] Error 1



Test script:
---------------
So without a system level installation of zip.h the following will fail during make with: fatal error: zip.h: No such file or directory

./configure \
--prefix=/opt/php72 \
--enable-zip \
--with-libzip=/opt/libzip \
--with-zlib && make



Expected result:
----------------
In file included from main/internal_functions_cli.c:36:0:
/usr/local/src/git-php72-build/php-src/ext/zip/php_zip.h:31:17: fatal error: zip.h: No such file or directory
 #include <zip.h>
                 ^
compilation terminated.
make: *** [main/internal_functions_cli.lo] Error 1


Patches

libzip_config.m4_add_PHP_ADD_INCLUDE_macro (last revision 2018-05-15 22:00 UTC by tholforty at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-16 07:08 UTC] tholforty at gmail dot com
-Package: zip +Package: Compile Failure
 [2018-05-16 07:08 UTC] tholforty at gmail dot com
Changed to compile failure, since it is not an issue with PECL:Zip
 [2018-06-14 08:00 UTC] imoco at qq dot com
me too,my php version:7.2.6 os:centos 7.5
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 17 04:01:25 2018 UTC