When I try to connect a bundle in symfony, the console in Windows writes:

php is not recognized

  • Maybe symfony ;) never used cmd, because I use openserver as the local environment, which gives a normal console through which you can interact with the server. ____ Yes, and your problem is that the paths are not registered for php.exe ____ @ Roman Rakzin, If you are given an exhaustive answer, mark it as correct (click on the check mark next to the selected answer). - Bastiane

1 answer 1

The solution to this problem is simple:

My computer -> Advanced system settings -> Environment variables -> Path -> Change -> Paste the path to the folder with PHP -> OK -> OK`

  • I will add: the machine needs to know the full path to the executable file in order to execute it, for example /usr/bin/php or C:\Program Files\Vendor\binary.exe . In order not to write this canoe every time from the console, they invented two pieces — relative paths (relative to the current working folder) and $ PATH — a variable in which all folders containing executable files that need quick access by name are written. After the desired folder has fallen into $ PATH, the OS has the ability to search for the desired binary in it before falling out with an error. - etki