6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PHP Docker で composer require linecorp/line-bot-sdk がコケる

Last updated at Posted at 2020-06-11

状況

Docker Image : php:7.4.6-fpm-alpine3.11

ログ

# composer require linecorp/line-bot-sdk
Using version ^4.4 for linecorp/line-bot-sdk
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - linecorp/line-bot-sdk 4.4.1 requires ext-sockets * -> the requested PHP extension sockets is missing from your system.
    - linecorp/line-bot-sdk 4.4.0 requires ext-sockets * -> the requested PHP extension sockets is missing from your system.
    - Installation request for linecorp/line-bot-sdk ^4.4 -> satisfiable by linecorp/line-bot-sdk[4.4.0, 4.4.1].

  To enable extensions, verify that they are enabled in your .ini files:
    - 
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

the requested PHP extension sockets is missing from your system.

socketsが無いよというお話でした。

対処

Dockerfile内でsocketsをインストールするだけ。

~略~
RUN docker-php-ext-install sockets
~略~

結果

無事、インストール完了

 # composer require linecorp/line-bot-sdk
Using version ^4.4 for linecorp/line-bot-sdk
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing linecorp/line-bot-sdk (4.4.1): Downloading (100%)         
linecorp/line-bot-sdk suggests installing apigen/apigen (Install with roave/better-reflection:dev-master to generate docs)
linecorp/line-bot-sdk suggests installing roave/better-reflection (Required by apigen/apigen:dev-master)
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
34 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
6
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?