Skip to content

symfony local:php:list cannot find PHP provided by Herd on Windows #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chrisdeeming opened this issue Apr 14, 2024 · 0 comments · Fixed by #18
Closed

symfony local:php:list cannot find PHP provided by Herd on Windows #17

chrisdeeming opened this issue Apr 14, 2024 · 0 comments · Fixed by #18

Comments

@chrisdeeming
Copy link
Contributor

I use Laravel Herd on Windows as a general purpose PHP/Node development environment. I'm having issues with getting symfony-cli to detect the PHP binary it provides.

symfony local:php:list -vvv
4:25AM DBG Looking for PHP in C:\xampp\php (<nil>) -- XAMPP
4:25AM DBG Looking for PHP in C:\cygwin64\bin (<nil>) -- Cygwin
4:25AM DBG Looking for PHP in C:\cygwin\bin (<nil>) -- Cygwin
4:25AM DBG   Skipping C:\Program Files\Git\cmd, already in the PATH
4:25AM DBG Looking for PHP in the PATH ([C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_188806375 C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler C:\Windows\System32 C:\Windows C:\Windows\System32\wbem C:\Windows\System32\WindowsPowerShell\v1.0 C:\Windows\System32\OpenSSH C:\Program Files\Amazon\AWSCLIV2 C:\ProgramData\chocolatey\bin C:\Program Files\dotnet C:\Program Files\Git\cmd C:\Users\chris\.config\herd\bin\nvm C:\Users\chris\.config\herd\bin\nvm\v21.7.3 C:\Users\chris\scoop\shims C:\Users\chris\.config\herd\bin C:\Users\chris\AppData\Local\Microsoft\WindowsApps C:\Users\chris\AppData\Local\Programs\Microsoft VS Code\bin C:\Users\chris\AppData\Local\JetBrains\Toolbox\scripts C:\Program Files\Git\bin])
4:25AM DBG Looking for PHP in C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_188806375 (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Windows\System32 (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Windows (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Windows\System32\wbem (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Windows\System32\WindowsPowerShell\v1.0 (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Windows\System32\OpenSSH (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Program Files\Amazon\AWSCLIV2 (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\ProgramData\chocolatey\bin (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Program Files\dotnet (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Program Files\Git\cmd (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Users\chris\.config\herd\bin\nvm (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Users\chris\.config\herd\bin\nvm\v21.7.3 (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Users\chris\scoop\shims (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Users\chris\.config\herd\bin (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Users\chris\AppData\Local\Microsoft\WindowsApps (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Users\chris\AppData\Local\Programs\Microsoft VS Code\bin (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Users\chris\AppData\Local\JetBrains\Toolbox\scripts (<nil>) -- PATH
4:25AM DBG Looking for PHP in C:\Program Files\Git\bin (<nil>) -- PATH
+---------+-----------+---------+---------+---------+--------+---------+
| Version | Directory |   PHP   |   PHP   |   PHP   | Server | System? |
|         |           |   CLI   |   FPM   |   CGI   |        |         |
+---------+-----------+---------+---------+---------+--------+---------+
+---------+-----------+---------+---------+---------+--------+---------+

The CLI doesn't find it via PATH because the binary is under a php83 sub-directory.

It seems to me it might be beneficial to extend the known paths that are looked for to include %USERPROFILE%/.config/herd/bin and all its subdirectories.

For now I've added .config/herd/bin/php83 directly to PATH to workaround this which seems to work:

+---------+---------------------------------------+---------+---------+-------------+---------+---------+
| Version |               Directory               |   PHP   |   PHP   |     PHP     | Server  | System? |
|         |                                       |   CLI   |   FPM   |     CGI     |         |         |
+---------+---------------------------------------+---------+---------+-------------+---------+---------+
| 8.3.6   | C:\Users\chris\.config\herd\bin\php83 | php.exe |         | php-cgi.exe | PHP CGI | *       |
+---------+---------------------------------------+---------+---------+-------------+---------+---------+

Naturally, the PATH would need to be updated to include each PHP version you install through Herd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant