dockerでphp(ver8.0)のコンテナを作成し他にもかかわらず、
どこかにインストールされているphp(ver7.3)が反応してしまい、phpunitを実行した時に以下のエラーが発生して困ってます。
#phpunitのバージョンを確認しようとしたら、、、 > ./vendor/bin/phpunit --version Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.3.11. in /Users/tom/dev/nextat/recruit-php-04-yonechitest/src/vendor/composer/platform_check.php on line 24
> php -v PHP 7.3.11 (cli) (built: Apr 17 2020 19:14:14) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
dockerfile
1#phpunitのバージョンを確認しようとしても、、、 2FROM php:8.0-fpm 3 4# For composer 5RUN apt-get update && apt-get install -y \ 6 git \ 7 iputils-ping \ 8 net-tools \ 9 zlib1g-dev \ 10 unzip \ 11 libzip-dev \ 12 libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libaio1 \ 13 && docker-php-ext-install gd zip pdo_mysql 14 15# Install composer 16COPY --from=composer:2.0 /usr/bin/composer /usr/bin/composer 17 18# Set composer environment 19ENV COMPOSER_ALLOW_SUPERUSER 1 20ENV COMPOSER_HOME /composer 21ENV PATH $PATH:/composer/vendor/bin 22 23WORKDIR /var/www/src
dockercomposeyml
1version: "3" 2services: 3 nginx: 4 image: nginx 5 ports: 6 - "80:80" 7 depends_on: 8 - php 9 volumes: 10 - ./containers/nginx/nginx.conf:/etc/nginx/nginx.conf 11 - ./containers/nginx/conf.d:/etc/nginx/conf.d 12 - ./src:/var/www/src 13 14 php: 15 build: ./containers/php 16 working_dir: /var/www/src 17 volumes: 18 - ./src:/var/www/src 19 20 mysql: 21 image: mysql:8.0 22 environment: 23 MYSQL_DATABASE: example 24 MYSQL_ROOT_PASSWORD: secret 25 ports: 26 - "3306:3306" 27
回答1件
あなたの回答
tips
プレビュー