Die*_*loa 5 php laravel docker laravel-excel
我正在尝试在使用PHP 7.4的Docker 容器中运行的Larevel 7中安装Laravel Excel,但出现此错误,但我不知道如何修复。
\n\ne-learning-app/src on \xee\x82\xa0 dev [$!] via \xe2\xac\xa2 v12.8.1 via v7.4.4\n\xe2\x9e\x9c docker:composer require maatwebsite/excel\nStarting e-learning-app-php ... done\nUsing version ^3.1 for maatwebsite/excel\n./composer.json has been updated\nLoading composer repositories with package information\nUpdating dependencies (including require-dev)\nYour requirements could not be resolved to an installable set of packages.\n\n Problem 1\n - maatwebsite/excel 3.1.x-dev requires phpoffice/phpspreadsheet ^1.11 -> satisfiable by phpoffice/phpspreadsheet[1.11.0, 1.12.0, 1.13.0].\n - maatwebsite/excel 3.2.x-dev requires phpoffice/phpspreadsheet ^1.11 -> satisfiable by phpoffice/phpspreadsheet[1.11.0, 1.12.0, 1.13.0].\n - maatwebsite/excel 3.1.0 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.1 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.10 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.11 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.12 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.13 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.14 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.15 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.16 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.17 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.18 requires phpoffice/phpspreadsheet ^1.10 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0].\n - maatwebsite/excel 3.1.19 requires phpoffice/phpspreadsheet ^1.10 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0].\n - maatwebsite/excel 3.1.2 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.3 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.4 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.5 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.6 requires phpoffice/phpspreadsheet ^1.4 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.7 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.8 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - maatwebsite/excel 3.1.9 requires phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].\n - phpoffice/phpspreadsheet 1.9.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.8.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.8.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.8.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.7.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.6.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.5.2 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.5.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.5.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.4.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.4.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.13.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.12.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.11.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.10.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - phpoffice/phpspreadsheet 1.10.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.\n - Installation request for maatwebsite/excel ^3.1 -> satisfiable by maatwebsite/excel[3.1.0, 3.1.1, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.1.16, 3.1.17, 3.1.18, 3.1.19, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.8, 3.1.9, 3.1.x-dev, 3.2.x-dev].\n\n To enable extensions, verify that they are enabled in your .ini files:\n - /usr/local/etc/php/php-cli.ini\n - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini\n - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini\n You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.\n\nInstallation failed, reverting ./composer.json to its original content.\n\ne-learning-app/src on \xee\x82\xa0 dev [$!] via \xe2\xac\xa2 v12.8.1 via v7.4.4 took 3m 1s\n\xe2\x9e\x9c\n
Run Code Online (Sandbox Code Playgroud)\n\n我已经通过运行以下命令在容器内手动安装了gd :
\n\napt-get update && apt-get install -y --no-install-recommends \\\nbuild-essential \\\nzlib1g-dev \\\nlibpng-dev \\\n&& docker-php-ext-configure gd --enable-gd && docker-php-ext-install -j$(nproc) gd\n
Run Code Online (Sandbox Code Playgroud)\n\n但问题仍然存在,当我这样做时, gd似乎已安装php -m
:
# php -m\n[PHP Modules]\nCore\ncurl\npdo_mysql\n...\nzlib\ngd\n\n[Zend Modules]\n\n#\n
Run Code Online (Sandbox Code Playgroud)\n\n但是当我composer show -p
通过我的作曲家容器执行操作时,gd扩展名不会出现:
e-learning-app on \xee\x82\xa0 dev [$!?] on v19.03.8 took 1h 10s\n\xe2\x9e\x9c docker:composer show -p\nStarting e-learning-app-php ... done\ncomposer-plugin-api 1.1.0 The Composer Plugin API\ncomposer-runtime-api 1.0.0 The Composer Runtime API\next-ctype 7.4.6 The ctype PHP extension\next-curl 7.4.6 The curl PHP extension\next-date 7.4.6 The date PHP extension\next-dom 20031129 The dom PHP extension\next-fileinfo 7.4.6 The fileinfo PHP extension\next-filter 7.4.6 The filter PHP extension\next-ftp 7.4.6 The ftp PHP extension\next-hash 7.4.6 The hash PHP extension\next-iconv 7.4.6 The iconv PHP extension\next-json 7.4.6 The json PHP extension\next-libxml 7.4.6 The libxml PHP extension\next-mbstring 7.4.6 The mbstring PHP extension\next-mysqlnd 0 The mysqlnd PHP extension (actual version: mysqlnd 7.4.6)\next-openssl 7.4.6 The openssl PHP extension\next-pcre 7.4.6 The pcre PHP extension\next-PDO 7.4.6 The PDO PHP extension\next-pdo_sqlite 7.4.6 The pdo_sqlite PHP extension\next-Phar 7.4.6 The Phar PHP extension\next-posix 7.4.6 The posix PHP extension\next-readline 7.4.6 The readline PHP extension\next-Reflection 7.4.6 The Reflection PHP extension\next-session 7.4.6 The session PHP extension\next-SimpleXML 7.4.6 The SimpleXML PHP extension\next-sodium 7.4.6 The sodium PHP extension\next-SPL 7.4.6 The SPL PHP extension\next-sqlite3 7.4.6 The sqlite3 PHP extension\next-tokenizer 7.4.6 The tokenizer PHP extension\next-xml 7.4.6 The xml PHP extension\next-xmlreader 7.4.6 The xmlreader PHP extension\next-xmlwriter 7.4.6 The xmlwriter PHP extension\next-zip 1.15.6 The zip PHP extension\next-zlib 7.4.6 The zlib PHP extension\nlib-curl 7.67.0 The curl PHP library\nlib-libxml 2.9.10 The libxml PHP library\nlib-openssl 1.1.1.7 OpenSSL 1.1.1g 21 Apr 2020\nlib-pcre 10.34 The pcre PHP library\nphp 7.4.6 The PHP interpreter\nphp-64bit 7.4.6 The PHP interpreter, 64bit\nphp-ipv6 7.4.6 The PHP interpreter, with IPv6 support\n
Run Code Online (Sandbox Code Playgroud)\n\n我不知道为什么会这样。我尝试了很多事情但没有成功......
\n\n这是我Dockerfile
的 PHP
FROM php:7.4-fpm\n\nWORKDIR /var/www/html\n\nRUN docker-php-ext-install pdo_mysql\n
Run Code Online (Sandbox Code Playgroud)\n\n这是我的 php 部分docker-compose.yml
:
php:\n build:\n context: .\n dockerfile: Dockerfile\n container_name: e-learning-app-php\n volumes:\n - ./src:/var/www/html\n ports:\n - "9007:9000"\n networks:\n - laravel\n
Run Code Online (Sandbox Code Playgroud)\n\n还有我的作曲家部分:
\n\ncomposer:\n image: composer:latest\n container_name: e-learning-app-composer\n volumes:\n - ./src:/var/www/html\n working_dir: /var/www/html\n depends_on:\n - php\n networks:\n - laravel\n
Run Code Online (Sandbox Code Playgroud)\n\n帮助。
\n 归档时间: |
|
查看次数: |
3082 次 |
最近记录: |