Running composer
on Windows UNC network path results in:
[ErrorException]proc_open(NUL): Failed to open stream: Permission denied
Problem
If you came here, you perhaps try to run composer on a windows UNC network path like //my-network-machine/my-php-project
There are several issues for this problem but sadly I wasn't able to find a final, simple solution yet and also current PHP 8 versions plus latest composer don't solve the problem for me.
Existing issues
Issues and discussions I found for that were for example:
- https://github.com/composer/composer/issues/8152
- https://github.com/composer/composer/issues/7112
- https://stackoverflow.com/questions/48554848/composer-returning-proc-op…
Solution
The only working solution I was able to find was to map a network drive on my device for the path instead of using the UNC //
path.
You can see here how it works: https://support.microsoft.com/en-us/windows/map-a-network-drive-in-wind…
Then opening the CMD / PowerShell / (Git) Bash on that network drive and running composer works without any problems!
From my perspective this still seems to be a PHP Bug even in 8.x on Windows not being able to work correctly on UNC network paths. If you should find any further final information, please contact me to update this blog article.
I hope it helped, thank you!