0
0

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 5 years have passed since last update.

laradock(Docker)+PhpStorm環境のxdebug導入でphp-fpmのエラーが起きる

Last updated at Posted at 2019-05-25

laradock環境でのxdebug導入手順
を参考にしてxdebug導入で躓いたのでメモ。
たぶんブログの環境とは違うので起きたと思われる。

設定ファイルをブログの通りに設定、イメージ再構築の段階でエラー発生。

docker-compose up -d --build nginx mysql workspace 

エラー内容

E: Could not open file /var/lib/apt/lists/deb.debian.org_debian_dists_buster_main_binary-amd64_Packages.diff_Index - open (2: No such file or directory)
ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c if [ ${INSTALL_IMAGEMAGICK} = true ]; then     apt-get update &&     apt-get install -y libmagickwand-dev imagemagick &&     pecl install imagick &&     docker-php-ext-enable imagick ;fi' returned a non-zero code: 100

検索して、Laradockでphp-fpmのビルドが失敗する(ERROR: Service 'php-fpm' failed to build:)を見つける。
手順通りに実行したがエラーは解決できず。そもそもエラーメッセージを見比べてみたら微妙に違う。
調べ続けたらkit-starter-symfony-4-dockerのissueを見つけた。
結果的に
laradock/php-fpm/Dockerfileを編集。

###########################################################################
# ImageMagick:
###########################################################################

USER root

ARG INSTALL_IMAGEMAGICK=false

RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
    rm -rf /var/lib/apt/lists/* && \
    apt-get update && \
    apt-get install -y libmagickwand-dev imagemagick && \
    pecl install imagick && \
    docker-php-ext-enable imagick \
;fi

下記を追加して無事解決。

    rm -rf /var/lib/apt/lists/* && \
    apt-get update && \
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?