Search code examples
phplaravelxamppcomposer-phplaragon

Cant create laravel version 10 project but i do have PHP version 8.2


I have this php version in my desktop

PHP 8.2.2 (cli) (built: Jan 31 2023 21:19:11) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.2, Copyright (c) Zend Technologies

and i try to create laravel project with this code

composer create-project --prefer-dist laravel/laravel:^10.0 testa-project

but it said i can not create laravel 10 project because of this

Could not find package laravel/laravel with version 10.0 in a version 
installable using your PHP version, PHP extensions and Composer version.

anyone know the solution ?

i have try this solution but nothing works

  • change php version
  • switching from laragon to xampp or the opposite

Solution

  • Try to install laravel globally using laravel install by doing this composer global require laravel/installer then use this laravel new your-app-name to install the newest laravel. I make my app name to be temp, then move it directly to public folder after installing the project.