とを使用してStripeをインストールしようとすると、エラーが発生します。docker
composer.json
これが私のcomposer.json
:
{
"require": {
"smarty/smarty": "^3.1",
"stripe/stripe-php": "^6.13"
}
}
ぼくの Dockerfile
FROM php:7.2.6-apache
RUN docker-php-ext-install mysqli curl
と私がしたときのエラーのログ docker-compose up
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20170718/
Installing header files: /usr/local/include/php/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la modules/* libs/*
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
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 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 whether cc understands -c and -o together... yes
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-20170718
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for cURL support... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking for libcurl.pc... using default path
checking for cURL 7.10.5 or greater... configure: error: cURL version 7.10.5 or later is required to compile php with cURL support
ERROR: Service 'www' failed to build: The command '/bin/sh -c docker-php-ext-install mysqli curl' returned a non-zero code: 1
修正が見つからない、または何が間違っているのか。手伝ってくれてありがとう
私の友人によって与えられた解決策。cURLはすでにphpパッケージ内にあり、インストールする必要はありません。しかし、それはもっと複雑でした。私のDockerfile
:
FROM composer AS vendor
COPY composer.json .
COPY composer.lock .
RUN composer install
FROM php:7.3-apache
COPY --from=vendor /app/vendor/ vendor/
COPY www ./
RUN mkdir templates_c
RUN mkdir cache
RUN chown www-data:www-data templates_c cache
VOLUME /var/www/html/templates_c/
VOLUME /var/www/html/cache/
RUN docker-php-ext-install mysqli
ぼくの docker-compose.yml
version: "2"
services:
www:
build: .
ports:
- "80:80"
volumes:
- ./www/lib:/var/www/html/lib
- ./www/modules:/var/www/html/modules
- ./www/theme:/var/www/html/theme
- ./www/index.php:/var/www/html/index.php
- ./www/notes.php:/var/www/html/notes.php
- ./www/tuto_array.php:/var/www/html/tuto_array.php
links:
- db
networks:
- default
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加