composer와 php를 설치하고 laravel 프로젝트를 생성할 때 아래와 같은 오류가 발생한다.
> laravel new example-app
_ _
| | | |
| | __ _ _ __ __ ___ _____| |
| | / _` | '__/ _` \ \ / / _ \ |
| |___| (_| | | | (_| |\ V / __/ |
|______\__,_|_| \__,_| \_/ \___|_|
Creating a "laravel/laravel" project at "./example-app"
Info from https://repo.packagist.org: #StandWithUkraine
Installing laravel/laravel (v9.3.10)
- Installing laravel/laravel (v9.3.10): Extracting archive
Created project in C:\Users\wjdgu/example-app
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v9.36.4, ..., 9.x-dev] require league/flysystem ^3.8.0 -> satisfiable by league/flysystem[3.8.0, ..., 3.x-dev].
- laravel/framework[v9.19.0, ..., v9.36.3] require league/flysystem ^3.0.16 -> satisfiable by league/flysystem[3.0.16, ..., 3.x-dev].
- league/flysystem[3.0.16, ..., 3.x-dev] require league/mime-type-detection ^1.0.0 -> satisfiable by league/mime-type-detection[1.0.0, ..., 1.11.0].
- league/mime-type-detection[1.0.0, ..., 1.3.0] require php ^7.2 -> your php version (8.0.23) does not satisfy that requirement.
- league/mime-type-detection[1.4.0, ..., 1.11.0] require ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
- Root composer.json requires laravel/framework ^9.19 -> satisfiable by laravel/framework[v9.19.0, ..., 9.x-dev].
해결 방법은 php.ini 부분에 extension으로 php_fileinfo가 필수적으로 있어야 합니다.
extension=php_fileinfo
해당 구문을 추가한 후 다시 laravel 프로젝트 생성 명령어를 치게 되면 아래와 같이
정상적으로 프로젝트가 생성 되는걸 확인할 수 있다.
> @php artisan package:discover --ansi
INFO Discovering packages.
laravel/sail ................................................................................................................................ DONE
laravel/sanctum ............................................................................................................................. DONE
laravel/tinker .............................................................................................................................. DONE
nesbot/carbon ............................................................................................................................... DONE
nunomaduro/collision ........................................................................................................................ DONE
nunomaduro/termwind ......................................................................................................................... DONE
spatie/laravel-ignition ..................................................................................................................... DONE
81 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force
INFO No publishable resources for tag [laravel-assets].
No security vulnerability advisories found
> @php artisan key:generate --ansi
INFO Application key set successfully.
INFO Application ready! Build something amazing.
> php artisan serve
INFO Server running on [http://127.0.0.1:8000].
Press Ctrl+C to stop the server
'언어 & 프레임워크 > PHP' 카테고리의 다른 글
[Laravel] timezone 설정 (0) | 2023.02.10 |
---|---|
[Laravel] HTTP 예외 처리하기 (0) | 2023.01.04 |
PHP 스프레드 연산자 (0) | 2022.11.09 |
페이징 성능 개선 - No Offset (0) | 2022.09.26 |
PHP PDO json_encode strings as numbers 반환 오류 (2) | 2022.09.20 |