0

I am trying to install Symfony 4.0 (specifically 4.0.99) to prepare for Symfony SF4 certification but each time composer installs 4.4.11 instead.

I tried:

composer create-project symfony/website-skeleton="4.0.99" skeleton
composer create-project symfony/website-skeleton="4.0.*" skeleton
composer create-project symfony/website-skeleton="~4.0.99" skeleton
composer create-project symfony/website-skeleton skeleton "4.0.99"

Even if all packages in vendor folder are listed with 4.0.9 versions, the main page of the application fails to open because of different errors:

In ArrayNode.php line 327:
Unrecognized option "cookie_samesite" under "framework.session". Available
options are "cookie_domain", "cookie_httponly", "cookie_lifetime",
"cookie_path", "cookie_secure", "enabled", "gc_divisor", "gc_maxlifetime",
"gc_probability", "handler_id", "metadata_update_threshold", "name",
"save_path", "storage_id", "use_cookies".

I tried using raw composer.json for 4.0 branch and then stricly modified each dependency to "4.0.9".

I tried using PHP 7.0 instead of PHP 7.1 and use --ignore-platform-reqs

Is something wrong with my OS? Can you get fresh working installation of Symfony 4.0?

David Medinets
  • 5,160
  • 3
  • 29
  • 42
  • 2
    Here this url already has the answer https://stackoverflow.com/questions/25749655/how-do-i-create-a-project-based-on-a-specific-version-of-symfony-using-composer . Try it by your self . – Kaviranga Jul 30 '20 at 01:14
  • There is no version 4.0.99 of Symfony, the latest version of Symfony 4.0 is 4.0.15 – Nico Haase Jul 30 '20 at 08:25
  • @NicoHaase thx, versioning is kind of confusing within what I see in tags in repo and what I see as I use composer create-project – Alberto Guerra Aug 01 '20 at 13:59
  • @kaviranga that's not the answer simply because using ^ in front of the package version will give you last stable version with this number, e.g ^4.4 = 4.4 and ^4.0 = 4.4. I need 4.0 precisely. – Alberto Guerra Aug 01 '20 at 14:01
  • 1
    The answer was to use specific restrictions in composer.json - https://pastebin.com/AZJKRKSD – Alberto Guerra Aug 01 '20 at 14:17
  • @AlbertoGuerra Please, write a real answer for this question with this code and more explanation. – Liscare Aug 02 '20 at 09:30

1 Answers1

1

Via composer, what the Symfony documentation says:

 composer create-project symfony/website-skeleton:^4.4 my_project_name

You can also do like this:

composer create-project symfony/website-skeleton my_project_name 4.4

You should not use quote for the version in the composer command. So, your command will be like (it works with me):

composer create-project symfony/website-skeleton:4.0.99 skeleton

About requirements for Symfony 4.0:

To create your new Symfony application, first make sure you’re using PHP 7.1 or higher and have Composer installed.

If you still want to use PHP 7.0 for your app, check this answer or use --ignore-platform-reqs to ignore php and ext requirements as you did.

Liscare
  • 336
  • 2
  • 14