how does the symfony v6 cli locate the platform (platform.sh) executable?

45 Views Asked by At

I am trying out the integration between the Symfony 6 cli and platform.sh. All commands in the symfony cli "cloud" namespace fail because the symfony cli is looking for the platform executable in the wrong place. The error message comes back

exec: "C:\\cygwin64\\home\\dougw\\.platformsh\\bin\\platform": executable file not found in %PATH%

Oddly, cygwin64 is not installed on my machine (anymore) and the platform executable was installed via scoop. Also, the platform executable is available in powershell. The scoop "shims" are in place and working correctly.

I could tell the symfony cli where to find the platform executable if that were absolutely necessary, if only I knew how. But that seems like working around scoop.

Why is the symfony cli not just looking for platform.exe in the path first (e.g. ~\scoop\shims). I have no idea how the symfony cli decided to look in c:\cygwin64\etc..... I have uninstalled and reinstalled the symfony cli, but it made no difference.

1

There are 1 best solutions below

0
On

The Symfony CLI relies on the $HOME environment variable. In my case, it was set to something non-sensical, which I fixed. BUT, the symfony cli is hardcoded to look in $HOME/.platformsh/bin for the platform executable. So you need to put a copy of the executable there in order for the symfony cli to find it. It is worth noting perhaps that the direction to install the platform cli on windows instructs one to use scoop. Scoop is a nice utility, but it will NOT put the executable in the directory mentioned above. You will need to copy it manually. Just copy the single file platform.exe to the correct directory, that is all that is required.