Error during installation Your requirements could not be resolved

Hey Everyone I have an error “Your requirements could not be resolved to an installable set of packages” when i type composer create-project --prefer-dist yiisoft/yii2-app-basic basic
I am just trying to install basic project Yii2
Here is a screenshot


How can I fix it? maybe Is it related with php version? ,if it is ,my php version is 8.0.20
please help me I am stuck with this error
I will be gratefull for help

I think the installation will work if you first install curl.

(remember to restart the web server.)

well I have installed curl before
but i cannot even run server
and there is still this error when i try to install Yii

Search/check extensions section in php.ini.
(/etc/php[x]/cli and /etc/php[x]/apache)

How did you install it?
The error about PHP version can be ignored by adding --ignore-platform-reqs to composer command

Well firstly I used these comands to install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer and then i created project Yii by this command composer create-project --prefer-dist yiisoft/yii2-app-basic basic
But this doesn’t work and i get that error requirments could not be resolved e.t.c
Secondly I also tried to install yii via archive file
And It worked I ran a server using comand php yii serve and i saw page Congratulations,But it later gave me new error

So i just need to add this command like composer create-project–ignore-platform-reqs --prefer-dist yiisoft/yii2-app-basic basic right?

You are running this on your own account if you ignore the requirements. You should met them first in order for everything to work properly. You state that you have installed curl before but apparently you have done it somehow wrong if it cannot be detected on your system.

1 Like

Yes, but I would only do this for PHP version mismatch. I always use latest PHP in my dev machine and sometimes is not yet supported. But for missing packages I will not ignore it, unless am sure it won’t break anything.

As of your errors, it is clear. If you ignore that, all functionalities requiring curl like codeception won’t work.

I wonder why not just do sudo apt install php8-curl to install it?

from his explanations here:

I guess he mixes curl executable with curl-php a PHP extension!

Thank you very much
this command solved the error