If you have this problem :
unable to run C:\ProgramData\ComposerSetup\bin\composer.phar create-project symfony/skeleton
In this case check php version used by the command symfony :
symfony local:php:list
Version | Directory | PHP CLI | PHP FPM | PHP CGI | Server | System? |
5.6.40 | C:\wamp64\bin\php\php5.6.40 | php.exe | php-cgi.exe | PHP CGI | ||
7.3.21 | C:\wamp64\bin\php\php7.3.21 | php.exe | php-cgi.exe | PHP CGI | * | |
7.4.9 | C:\wamp64\bin\php\php7.4.9 | php.exe | php-cgi.exe | PHP CGI | ||
8.2.1 | C:\wamp64\bin\php\php8.2.1 | php.exe | php-cgi.exe | PHP CGI |
In my case php cli version is at 7.3.21 so i need to put it in another version on witch symfony can work normaly (you can find the correspondant version of php in symfony documentation, it is by symfony bundle version).
to resolv e the problem we have 2 possibilities
solution 1:
install another symfony version that works on php version :symfony new my_project --version="4.4"
solution 2:
change php path:
- Search for system environment variables in cortana.
- Click on the button « Environment variables ».
- Under « System variables » select path and click on edit, you will see one entry like this « C:\wamp\bin\php\php7.3.21« .
- Just change this to path of the php located at your wamp/bin/php8.1.2
- save and try again then command symfony new …
=> if these solutions havn’t help you for some then creation of the project directly with composer is a bridge solution:
composer create-project symfony/website-skeleton my_project
you still have the problem try to check requirements first:
symfony check:requirements
C:\wamp64\bin\php\php8.2.1\php.ini
> Checking Symfony requirements:
..........W..WWW........W
[OK]
Your system is ready to run Symfony projects
Optional recommendations to improve your setup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* mb_strlen() should be available
> Install and enable the mbstring extension.
* intl extension should be available
> Install and enable the intl extension (used for validators).
* a PHP accelerator should be installed
> Install and/or enable a PHP accelerator (highly recommended).
* realpath_cache_size should be at least 5M in php.ini
> Setting "realpath_cache_size" to e.g. "5242880" or "5M" in
> php.ini* may improve performance on Windows significantly in some
> cases.
* PDO should have some drivers installed (currently available: none)
> Install PDO drivers (mandatory for Doctrine).
Note The command console can use a different php.ini file
~~~~ than the one used by your web server.
Please check that both the console and the web server
are using the same PHP version and configuration.
in my case i should activate 2 extentions and install a pdo driver fo my php 8.2.1
Thank you.