richarvey / nginx-php-fpm

Nginx and php-fpm for dockerhub builds
https://hub.docker.com/repository/docker/richarvey/nginx-php-fpm/general
GNU General Public License v3.0
1.66k stars 852 forks source link

Dockerfile image can not build #262

Closed duiniwukenaihe closed 2 years ago

duiniwukenaihe commented 2 years ago

I use the repository's Dockerfile to build the image, but I can't build it successfully:

In file included from /usr/local/include/php/Zend/zend_config.h:1,
                 from /usr/local/include/php/Zend/zend_portability.h:43,
                 from /usr/local/include/php/Zend/zend_types.h:25,
                 from /usr/local/include/php/Zend/zend.h:27,
                 from /usr/local/include/php/main/php.h:31,
                 from /usr/src/php/ext/iconv/iconv.c:23:
/usr/local/include/php/main/../main/php_config.h:1802: warning: "ICONV_BROKEN_IGNORE" redefined
 1802 | #define ICONV_BROKEN_IGNORE 0
      | 
In file included from /usr/src/php/ext/iconv/iconv.c:20:
/usr/src/php/ext/iconv/config.h:56: note: this is the location of the previous definition
   56 | #define ICONV_BROKEN_IGNORE 1
      | 
/usr/src/php/ext/iconv/iconv.c: In function 'zm_startup_miconv':
/usr/src/php/ext/iconv/iconv.c:197:4: error: '_libiconv_version' undeclared (first use in this function)
  197 |    _libiconv_version >> 8, _libiconv_version & 0xff);
      |    ^~~~~~~~~~~~~~~~~
/usr/src/php/ext/iconv/iconv.c:197:4: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/php/ext/iconv/iconv.c: In function '_php_iconv_appendl':
/usr/src/php/ext/iconv/iconv.c:97:15: warning: implicit declaration of function 'libiconv'; did you mean 'zif_iconv'? [-Wimplicit-function-declaration]
   97 | #define iconv libiconv

i found this issues:

https://github.com/docker-library/php/issues/1121.

whatcan i do ?build this image

xdendev commented 2 years ago
do u solved ? I have this problem too, i try change version of image and libiconv but still does not work `In file included from /usr/local/include/php/Zend/zend_config.h:1, from /usr/local/include/php/Zend/zend_portability.h:43, from /usr/local/include/php/Zend/zend_types.h:25, from /usr/local/include/php/Zend/zend.h:27, from /usr/local/include/php/main/php.h:31, from /usr/src/php/ext/iconv/iconv.c:23: /usr/local/include/php/main/../main/php_config.h:1802: warning: "ICONV_BROKEN_IGNORE" redefined 1802 #define ICONV_BROKEN_IGNORE 0
In file included from /usr/src/php/ext/iconv/iconv.c:20: /usr/src/php/ext/iconv/config.h:56: note: this is the location of the previous definition 56 #define ICONV_BROKEN_IGNORE 1

/usr/src/php/ext/iconv/iconv.c: In function 'zm_startup_miconv': /usr/src/php/ext/iconv/iconv.c:197:4: error: '_libiconv_version' undeclared (first use in this function) 197 | _libiconv_version >> 8, _libiconv_version & 0xff); | ^~~~~ /usr/src/php/ext/iconv/iconv.c:197:4: note: each undeclared identifier is reported only once for each function it appears in /usr/src/php/ext/iconv/iconv.c: In function '_php_iconv_appendl': /usr/src/php/ext/iconv/iconv.c:97:15: warning: implicit declaration of function 'libiconv'; did you mean 'zif_iconv'? [-Wimplicit-function-declaration] 97 | #define iconv libiconv | ^~~~ /usr/src/php/ext/iconv/iconv.c:363:8: note: in expansion of macro 'iconv' 363 | if (iconv(cd, (char )&in_p, &in_left, (char ) &out_p, &out_left) == (size_t)-1) { | ^~~~~ make: *** [Makefile:202: iconv.lo] Error 1 `

duiniwukenaihe commented 2 years ago

I temporarily commented out iconv and compiled it. It depends on what is the best way for you

xdendev commented 2 years ago

cant, becouse i use some functions from this lib

duiniwukenaihe commented 2 years ago

I took a closer look:

https://github.com/docker-library/php/blob/master/7.4/alpine3.15/fpm/Dockerfile 

already Use gnu-libiconv for php iconv extension on alpine In fact, iconv can be commented out here. After playing a mirror, I also found that there is iconv。

duiniwukenaihe commented 2 years ago

and 8.0 is also. so you can commented out here

xdendev commented 2 years ago

if i comment iconv i still can use functions iconv() in php ? php 8.1

duiniwukenaihe commented 2 years ago

I took the image of php 7.48-fpm and commented out the iconv image and started it. Entering the container to execute php-m is dependent on iconv. you may try it 。richarvey/nginx-php-fpm image three is based on the official base image:


https://github.com/docker-library/php/blob/master/8.1/alpine3.15/fpm/Dockerfile. 
```I took a look and there is gun-libiconv
richarvey commented 2 years ago

I can confirm that this can be removed and still you can use the lib inconv commands. It's now fixed in the 2.0.5 release