خرید بک لینک

I want to use .sh script for deployment of my app. That script is on my home server (Ubuntu 15.10 Server), marked as executable. Access to this script is done through ssh, using this tutorial, I have set up ssh login, that runs that script. So basically I just call ssh deployer@XXX.com someArguments and it runs my script with someArguments as parameters. The user deployer has uid=0, so its basically root (this will be changed in the future, I have set it only to eliminate permissions problems until it works fine).

And here is where the things get tricky. The script reports /usr/bin/env: php: No such file or directory at command /bin/composer install (using Composer). Things are more weird the more I look on that script. Before this line, there is also called /bin/composer self-update and /bin/composer -V, which both runs correctly and displays correct output.

I have checked following things:

  • /usr/bin/env php -v displays correct PHP version (same as /usr/bin/php -v)
  • whereis php displays php: /usr/bin/php /usr/local/bin/php /usr/share/man/man1/php.1.gz
  • php5-cli package is installed and newest version
  • $PATH contains /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
  • which env displays /usr/bin/env

I have also tried following things:

  • ruing the script directly as bash deploy.sh under root (since it is same as that user) - works perfectly without errors
  • ruing failing commands directly - also perfectly without errors

So this seems to me as very specific case, why this command does not work. I spent 12 hours of debugging it and I am out of ideas here.

P.S.: Similar error (/usr/bin/env: node: No such file or directory) occurs when there is bower install (using Bower), but not when ruing npm install (using NPM).

برچسب: نویسنده: استخدام کار تاريخ: شنبه 7 فروردين 1395 ساعت: 18:28

صفحه بندی