"Try Open Swoole with Docker" tutorial `docker build` fails: "fatal error: curl/curl.h: No such file or directory"
life5ign opened this issue · comments
- What did you do? If possible, provide a simple script for reproducing the error.
I copied the Dockerfile and built it as instructed on https://openswoole.com/docs/get-started/try-docker
- What did you expect to see?
A successful docker build.
- What did you see instead?
#0 21.41 g++ -I. -I/tmp/ext-openswoole -I/tmp/ext-openswoole/include -I/tmp/ext-openswoole/main -I/tmp/ext-openswoole -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 -I/tmp/ext-openswoole -I/tmp/ext-openswoole/i
nclude -I/tmp/ext-openswoole/ext-src -I/tmp/ext-openswoole/thirdparty/hiredis -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations
-std=c++11 -DENABLE_PHP_SWOOLE -DZEND_COMPILE_DL_EXT=1 -c /tmp/ext-openswoole/ext-src/swoole_curl.cc -MMD -MF ext-src/swoole_curl.dep -MT ext-src/swoole_curl.lo -fPIC -DPIC
-o ext-src/.libs/swoole_curl.o
#0 21.53 In file included from /tmp/ext-openswoole/ext-src/swoole_curl.cc:17:
#0 21.53 /tmp/ext-openswoole/ext-src/php_swoole_curl.h:25:10: fatal error: curl/curl.h: No such file or directory
#0 21.53 25 | #include <curl/curl.h>
#0 21.53 | ^~~~~~~~~~~~~
#0 21.53 compilation terminated.
#0 21.53 make: *** [Makefile:248: ext-src/swoole_curl.lo] Error 1
------
Dockerfile:11
--------------------
10 |
11 | >>> RUN cd /tmp && git clone https://github.com/openswoole/ext-openswoole.git && \
12 | >>> cd ext-openswoole && \
13 | >>> git checkout v22.0.0 && \
14 | >>> phpize && \
15 | >>> ./configure --enable-openssl --enable-hook-curl --enable-http2 --enable-mysqlnd && \
16 | >>> make && make install
17 |
--------------------
ERROR: failed to solve: process "/bin/sh -c cd /tmp && git clone https://github.com/openswoole/ext-openswoole.git && cd ext-openswoole && git checkout v22.0.0 &&
phpize && ./configure --enable-openssl --enable-hook-curl --enable-http2 --enable-mysqlnd && make && make install" did not complete successfully: exit code: 2
- What version of OpenSwoole are you using (show your
php --ri openswoole
)?
N/A, running in docker, but:Extension 'openswoole' not present.
- What is your machine environment used (show your
uname -a
&php -v
&gcc -v
) ?
Linux 6.2.6-76060206-generic #202303130630~1683753207~22.04~77c1465 SMP PREEMPT_DYNAMIC Wed M x86_64 x86_64 x86_64 GNU/Linux
PHP 8.1.2-1ubuntu2.11 (cli) (built: Feb 22 2023 22:56:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.11, Copyright (c), by Zend Technologies
# gcc
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04.1' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-aYxV0E/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-aYxV0E/gcc-11-11.3.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
You can also try the following OpenSwoole support channels:
- Documentation - Documentation for Open Swoole
- Slack - Slack channel of Open Swoole
- Discord - Discord server of Open Swoole
I meant to create this issue in openswoole/openswoole, so I'm closing it here, since I created it there.