実現したいこと
Laravelプロジェクトをローカル環境で動かすための環境構築。
発生している問題・分からないこと
現時点まで実施した作業
・dockerインストール
・VsCodeにてGitHubよりプロジェクトのクローン作成
※プロジェクト名:work_schedule_20211116
・ターミナルよりdockerコマンドにて、Composerパッケージをインストール
・ターミナルよりdockerコマンドにて、laravel/sailインストール
こちらのコマンドを実行した結果、以下のエラーメッセージが表示されました
エラーメッセージ
error
1Cannot create cache directory /.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only. 2Using version ^1.41 for laravel/sail 3./composer.json has been updated 4Running composer update laravel/sail 5Loading composer repositories with package information 6Cannot create cache directory /.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache. See also cache-read-only config if your filesystem is read-only. 7Updating dependencies 8Your requirements could not be resolved to an installable set of packages. 9 10 Problem 1 11 - phpoffice/phpexcel is locked to version 1.8.2 and an update of this package was not requested. 12 - phpoffice/phpexcel 1.8.2 requires php ^5.2|^7.0 -> your php version (8.0.22) does not satisfy that requirement. 13 Problem 2 14 - phpoffice/phpspreadsheet is locked to version 1.25.2 and an update of this package was not requested. 15 - phpoffice/phpspreadsheet 1.25.2 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. 16 Problem 3 17 - Root composer.json requires laravel/sail ^1.41 -> satisfiable by laravel/sail[v1.41.0, 1.x-dev]. 18 - laravel/sail[v1.41.0, ..., 1.x-dev] require illuminate/console ^9.52.16|^10.0|^11.0|^12.0 -> found illuminate/console[v9.52.16, 9.x-dev, v10.0.0, ..., 10.x-dev, v11.0.0, ..., 11.x-dev, v12.0.0, ..., 12.x-dev] but these were not loaded, likely because it conflicts with another require. 19 Problem 4 20 - phpoffice/phpspreadsheet 1.25.2 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension. 21 - maatwebsite/excel 3.1.43 requires phpoffice/phpspreadsheet ^1.18 -> satisfiable by phpoffice/phpspreadsheet[1.25.2]. 22 - maatwebsite/excel is locked to version 3.1.43 and an update of this package was not requested. 23 24To enable extensions, verify that they are enabled in your .ini files: 25 - /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini 26 - /usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini 27 - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini 28 - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini 29You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. 30Alternatively, you can run Composer with `--ignore-platform-req=ext-gd` to temporarily ignore these required extensions. 31You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/sail:*" to figure out if any version is installable, or "composer require laravel/sail:^2.1" if you know which you need. 32 33Installation failed, reverting ./composer.json and ./composer.lock to their original content.
該当のソースコード
docker
1$docker run --rm \ 2 -u "$(id -u):$(id -g)" \ 3 -v "$(pwd):/var/www/html" \ 4 -w /var/www/html \ 5 laravelsail/php80-composer:latest \ 6 composer install --ignore-platform-reqs 7 8$docker run --rm \ 9 -u "$(id -u):$(id -g)" \ 10 -v "$(pwd):/var/www/html" \ 11 -w /var/www/html \ 12 laravelsail/php80-composer:latest \ 13 composer require laravel/sail --dev
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
状況に変化はありませんでした。
補足
作業環境
MacOS Sonoma 14.0
DockerDesktop 4.38.0 (181591)
Laravel v8.79.0

あなたの回答
tips
プレビュー