composer/composer — pull request #3472 by antonioribeiro (2014-11-28 16:10:06+00:00)
Title: Use PHP to call the proxyed binary target

When Composer is not able to create a symlink to the binary, it creates a proxy shell script, but if the filesystem does not support symlinks it may also not support the executable bit, so the proxy script will try to execute a non executable file and the user, which was probably having to execute it this way:

sh vendor/bin/phpspec

Will receive this error message:

vendor/bin/phpspec: 7: vendor/bin/phpspec: /var/www/ci-app/vendor/phpspec/phpspec/bin/phpspec: Permission denied

Happens to me with all files in vendor/bin, because I use a Linux box as a server but the www folder is a mounted cifs share, to a Windows SSD drive, so I'm currently editing them and adding *php* before "$BIN_TARGET" "$@":

#!/usr/bin/env sh
SRC_DIR="`pwd`"
...
php "$BIN_TARGET" "$@"

The implementation does not take in consideration the fact that the binary may not be a PHP script, it's unlikely but still possible.