symfony/demo

Can't install via composer

LeikoDmitry opened this issue ยท 19 comments

Then I run the command for installation project:

composer create-project symfony/symfony-demo my_project

I am getting the error:
Could not find package symfony/symfony-demo with stability stable in a version installable using your PHP version, PHP extensions and Composer version.

PHP 8.1.8.
Composer 2.3.10

I've just run the command and it worked for me as expected:

Let's see if we can find why it failed for you ๐Ÿค”

Hmm...
Screenshot from 2022-07-20 10-53-36

Also I used the ubuntu 21.10

stof commented

Do you have a global composer config file disabling the packagist.org repository ?

Do you have a global composer config file disabling the packagist.org repository ?

No I don't have any config files for composer :)

Same error here when trying to create the demo application.
Composer 2.3.8, also checked on 2.3.10,
PHP 8.1.8
Ubuntu 21.10

It works for me on Ubuntu 18.04.6, PHP 8.1.8, Composer 2.3.7.

I have loads of PHP extensions installed. If I remove php8.1-sqlite, then it also fails for me:

$ composer create-project symfony/symfony-demo my_project
Creating a "symfony/symfony-demo" project at "./my_project"

In CreateProjectCommand.php line 435:

  Could not find package symfony/symfony-demo with stability stable in a version installable using your PHP version, PHP extensions and Composer version.
stof commented

@7ochem the upcoming composer 2.4 version will provide a better error message when there is no version compatible with your platform, by giving more details.

@stof that's exactly what I was going to add to my comment: Seems like a Composer issue that the message doesn't clearly state what is missing. Something like the output of composer why-not symfony/symfony-demo, except that you can't run composer why-not when you don't have composer initialised in your current working dir.

stof commented

@7ochem you can run composer self-update --snapshot to use the snapshot version of composer (which contains that change that will be part of the 2.4 release)

You can also add --ignore-platform-reqs to create-project to see if it's related to extensions.

I had to install php8.1-sqlite3 to get OP's issue to resolve. By the way, after updating composer to the snapshot version still didn't get a more descriptive error message.

I have the same problem, i'm using Ubuntu 20.04 with PHP 8.1.8
I can confirm that the issue is fixed after installing php8.1-sqlite3 as @nasgir suggest.

stof commented

@7ochem indeed. The extra info is displayed in composer require but not in composer create-project. I opened composer/composer#10959 about it.

When I added the sqlite php extension:
sudo apt install php8.0-sqlite3
The issue is fixed :)
For composer create-project need more details

stof commented

@LeikoDmitry See the discussion in Composer. It looks like this is already implemented in the snapshot version of composer (the upcoming 2.4 version), even though #1348 (comment) said the opposite.

I've removed the php8.0-sqlite3 also I upgraded the composer version 2.4 and try to install the symfony demo application, however, I saw the error:
Screenshot from 2022-07-21 18-45-55

Although the issue is for php sqlite extension :(

stof commented

Well, here, it shows that the latest version is not compatible with your platform due to the PHP version itself.

It indeed does not show warnings for all candidate versions

On my laptop was php version 8.0. I upgraded version and the compmoser showed more detail:
Screenshot from 2022-07-21 22-23-25
Composer should be version 2.4

On Manjaro. Had to manually enable pdo-sqlite extension in php.ini after its installation for this to work:

> symfony new ./symfony_demo --demo
* Creating a new Symfony Demo project with Composer
  (running /home/chriego/.local/bin/composer create-project symfony/symfony-demo /home/chriego/Projects/personal/symfony_demo  --no-interaction)

Creating a "symfony/symfony-demo" project at "./symfony_demo"
Cannot use symfony/symfony-demo's latest version v2.4.0 as it requires ext-pdo_sqlite * which is missing from your platform.

Notice the last line. Edit php.ini:

vim /etc/php/php.ini

Find line ;extension=pdo_sqlite and remove the ;