'Laravel 9 install error: PHP version, PHP extensions and Composer version on Windows

I installed Xampp version 3.3.0 which supports PHP 8.1 and composer version 2.3.5. When I change directory to htdocs directory of the xampp, and write

composer create-project laravel/laravel="9.*"

It reports error

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

The fileinfo extension is installed.

I should note that there is also an old version of xampp but I started the server of new Xampp



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source