I am getting error when trying to create symfony folder

177 Views Asked by At

I've installed symfony but now when i am trying to create a folder i see a error i have never seen before symfony : The term 'symfony' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • symfony new my_project_directory --version=5.4 --webapp
  •   + CategoryInfo          : ObjectNotFound: (symfony:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

enter link description here

I have tried guideness on other stackoverflow answers and tried some youtube video's nothing helped me out.

1

There are 1 best solutions below

0
On

From the video linked in your post, it seems like you're on Windows and your default Terminal is PowerShell. Symfony executable (or its installation) uses Bash, which isn't supported by windows, and the error is in the video:

The term 'bash' is not recognized ...

This error isn't related to PHP or Symfony, but to the underlying OS you're using. In my experience, programming in PHP on Windows itself is not convenient. I'd suggest to use Windows WSL2 so you don't run into these kinds of problems. I have experience with WSL2 as I'm using it myself, and I can nothing but recommend it.