本机不想装环境,想着跑个docker,装在容器里。开始采坑两天的历程:(先贴出成功的dockerfile)
FROM php:7.4-fpm
# 安装依赖
RUN apt update
RUN apt-get install git zip unzip libcurl4-gnutls-dev -y
RUN pecl update-channels https://pear.php.net
RUN pecl install msgpack redis yar
# 安装mysqli扩展
RUN docker-php-ext-enable redis yar
# 映射目录
WORKDIR /var/www/html
# 暴露端口
EXPOSE 9000
由于项目特殊性,项目采用的是yar-rpc框架,因此需要引进yar拓展,不巧的是,这个拓展不太好装。
官方php-fpm中,自带了如下命令:
docker-php-ext-install //安装php拓展,如fileinfo,mbstring等
docker-php-ext-enbale //启用php拓展使用docker-php-ext-install yar命令时
root@f83b8db9dbb8:/var/www/html# docker-php-ext-install yar
error: /usr/src/php/ext/yar does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] [--ini-name file.ini] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.不出意外的出错了,错误提示是yar不存在,那说明这个命令不支持安装yar。
于是尝试了pecl install yar
root@f83b8db9dbb8:/var/www/html# pecl install yar
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
pecl/yar can optionally use PHP extension "msgpack"
downloading yar-2.3.3.tgz ...
Starting to download yar-2.3.3.tgz (51,333 bytes)
.............done: 51,333 bytes
27 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Enable Msgpack Supports [no] :
building in /tmp/pear/temp/pear-build-defaultuserGmk2IU/yar-2.3.3
running: /tmp/pear/temp/yar/configure --with-php-config=/usr/local/bin/php-config --enable-msgpack=no
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 pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-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-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable yar support... yes, shared
checking for curl protocol support... yes, shared
checking for msgpack packager support... no
checking for epoll support... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
ERROR: `/tmp/pear/temp/yar/configure --with-php-config=/usr/local/bin/php-config --enable-msgpack=no' failed错误提示:Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
提示到了pecl channel-update pecl.php.net,可以执行下试试:
root@f83b8db9dbb8:/var/www/html# pecl channel-update pecl.php.net
Updating channel "pecl.php.net"
Update of Channel "pecl.php.net" succeeded接着继续执行安装命令:
root@f83b8db9dbb8:/var/www/html# pecl install yar
pecl/yar can optionally use PHP extension "msgpack"
downloading yar-2.3.3.tgz ...
Starting to download yar-2.3.3.tgz (51,333 bytes)
.............done: 51,333 bytes
27 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Enable Msgpack Supports [no] :
building in /tmp/pear/temp/pear-build-defaultuserkcnETG/yar-2.3.3
running: /tmp/pear/temp/yar/configure --with-php-config=/usr/local/bin/php-config --enable-msgpack=no
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 pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-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-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable yar support... yes, shared
checking for curl protocol support... yes, shared
checking for msgpack packager support... no
checking for epoll support... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
ERROR: `/tmp/pear/temp/yar/configure --with-php-config=/usr/local/bin/php-config --enable-msgpack=no' failed好消息,提示没了,出现了另一个提示:pecl/yar can optionally use PHP extension "msgpack",意思是少了个拓展?
那可以执行:
root@f83b8db9dbb8:/var/www/html# pecl install msgpack yar
pecl/yar can optionally use PHP extension "msgpack"
downloading msgpack-3.0.0.tgz ...
Starting to download msgpack-3.0.0.tgz (130,225 bytes)
.............................done: 130,225 bytes
downloading yar-2.3.3.tgz ...
Starting to download yar-2.3.3.tgz (51,333 bytes)
...done: 51,333 bytes
20 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
building in /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0
running: /tmp/pear/temp/msgpack/configure --with-php-config=/usr/local/bin/php-config
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 pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-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-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for msgpack support... yes, shared
checking for APC/APCU includes... not found
checking for a sed that does not truncate output... /bin/sed
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: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/bash /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack.c -o msgpack.lo
mkdir .libs
cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack.c -fPIC -DPIC -o .libs/msgpack.o
/bin/bash /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_pack.c -o msgpack_pack.lo
cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_pack.c -fPIC -DPIC -o .libs/msgpack_pack.o
In file included from /tmp/pear/temp/msgpack/msgpack_pack.c:4:
In function 'smart_str_appendl_ex',
inlined from 'msgpack_pack_long' at /tmp/pear/temp/msgpack/msgpack/pack_template.h:468:5:
/usr/local/include/php/Zend/zend_smart_str.h:121:2: warning: writing 2 bytes into a region of size 1 [-Wstringop-overflow=]
121 | memcpy(ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s), str, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'smart_str_appendl_ex',
inlined from 'msgpack_pack_long' at /tmp/pear/temp/msgpack/msgpack/pack_template.h:468:5:
/usr/local/include/php/Zend/zend_smart_str.h:121:2: warning: writing 2 bytes into a region of size 1 [-Wstringop-overflow=]
121 | memcpy(ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s), str, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function 'smart_str_appendl_ex',
inlined from 'msgpack_pack_str' at /tmp/pear/temp/msgpack/msgpack/pack_template.h:763:9:
/usr/local/include/php/Zend/zend_smart_str.h:121:2: warning: writing 2 bytes into a region of size 1 [-Wstringop-overflow=]
121 | memcpy(ZSTR_VAL(dest->s) + ZSTR_LEN(dest->s), str, len);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/bin/bash /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_unpack.c -o msgpack_unpack.lo
cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_unpack.c -fPIC -DPIC -o .libs/msgpack_unpack.o
/bin/bash /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_class.c -o msgpack_class.lo
cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_class.c -fPIC -DPIC -o .libs/msgpack_class.o
/bin/bash /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/libtool --mode=compile cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_convert.c -o msgpack_convert.lo
cc -I. -I/tmp/pear/temp/msgpack -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/msgpack/msgpack_convert.c -fPIC -DPIC -o .libs/msgpack_convert.o
/bin/bash /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/include -I/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/main -I/tmp/pear/temp/msgpack -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 -DHAVE_CONFIG_H -g -O2 -o msgpack.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/modules msgpack.lo msgpack_pack.lo msgpack_unpack.lo msgpack_class.lo msgpack_convert.lo
cc -shared .libs/msgpack.o .libs/msgpack_pack.o .libs/msgpack_unpack.o .libs/msgpack_class.o .libs/msgpack_convert.o -Wl,-soname -Wl,msgpack.so -o .libs/msgpack.so
creating msgpack.la
(cd .libs && rm -f msgpack.la && ln -s ../msgpack.la msgpack.la)
/bin/bash /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/libtool --mode=install cp ./msgpack.la /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/modules
cp ./.libs/msgpack.so /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/modules/msgpack.so
cp ./.libs/msgpack.lai /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/modules/msgpack.la
PATH="$PATH:/sbin" ldconfig -n /tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/modules
----------------------------------------------------------------------
Libraries have been installed in:
/tmp/pear/temp/pear-build-defaultuserJQ7jzf/msgpack-3.0.0/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'.
running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0" install
Installing shared extensions: /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/lib/php/extensions/no-debug-non-zts-20190902/
Installing header files: /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/include/php/
running: find "/tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0" | xargs ls -dils
833604 0 drwxr-xr-x. 1 root root 6 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0
833851 0 drwxr-xr-x. 1 root root 10 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr
833852 0 drwxr-xr-x. 1 root root 20 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local
833860 0 drwxr-xr-x. 1 root root 6 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/include
833861 0 drwxr-xr-x. 1 root root 6 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/include/php
833862 0 drwxr-xr-x. 1 root root 14 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/include/php/ext
833863 0 drwxr-xr-x. 1 root root 26 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/include/php/ext/msgpack
833864 4 -rw-r--r--. 1 root root 3220 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/include/php/ext/msgpack/php_msgpack.h
833853 0 drwxr-xr-x. 1 root root 6 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/lib
833854 0 drwxr-xr-x. 1 root root 20 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/lib/php
833855 0 drwxr-xr-x. 1 root root 50 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/lib/php/extensions
833856 0 drwxr-xr-x. 1 root root 20 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/lib/php/extensions/no-debug-non-zts-20190902
833857 464 -rwxr-xr-x. 1 root root 471584 Jun 12 09:52 /tmp/pear/temp/pear-build-defaultuserJQ7jzf/install-msgpack-3.0.0/usr/local/lib/php/extensions/no-debug-non-zts-20190902/msgpack.so
Build process completed successfully
Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20190902/msgpack.so'
Installing '/usr/local/include/php/ext/msgpack/php_msgpack.h'
install ok: channel://pecl.php.net/msgpack-3.0.0
27 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
Enable Msgpack Supports [no] :
building in /tmp/pear/temp/pear-build-defaultusersLpH1h/yar-2.3.3
running: /tmp/pear/temp/yar/configure --with-php-config=/usr/local/bin/php-config --enable-msgpack=no
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 pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-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-20190902
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable yar support... yes, shared
checking for curl protocol support... yes, shared
checking for msgpack packager support... no
checking for epoll support... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
ERROR: `/tmp/pear/temp/yar/configure --with-php-config=/usr/local/bin/php-config --enable-msgpack=no' failed可以看到,仍然失败了。
根据网友描述,可以执行命令:
root@f83b8db9dbb8:/var/www/html# apt install libcurl4-guntls-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libcurl4-guntls-dev这里如果报错,一般是没有更新apt,因此更新下就好了。
apt update