I have a docker container with php 8.0.0-dev and composer. I want to create a Laravel application to test the new PHP but I have some errors.
When I try to create a new laravel project with the command:
composer create-project laravel/laravel test
The error I get is that I don’t have the required PHP even though php 8.0.0 is greater than php 7.x.
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
- laravel/framework v5.6.9 requires php ^7.1.3 -> your PHP version (8.0.0-dev) does not satisfy that requirement.
- laravel/framework v5.6.8 requires php ^7.1.3 -> your PHP version (8.0.0-dev) does not satisfy that requirement.
...
...
Can I skip the php version check somehow?
I have tried with
--prefer-dist
and
--ignore-platform-reqs
but i obtain this error:
Problem 1
- Conclusion: don't install laravel/laravel v7.25.0|remove laravel/laravel v7.25.0
- Installation request for laravel/laravel v7.25.0 -> satisfiable by laravel/laravel[v7.25.0].
Any idea?
Thanks!!!
2
Answers
Laravel supports PHP 8.0 right now, however still some packages are not updated. It affects also some of the PHP extensions:
https://blog.remirepo.net/pages/PECL-extensions-RPM-status
Source: https://blog.laravel.com/laravel-php-8-support
You are trying to install laravel 5.
For PHP 8 you need at least laravel 6,7 or 8
I prefer laravel 8 (last one)
If you use docker according to laravel 8 documentation you can create project with command:
curl -s https://laravel.build/example-app | bash