简体   繁体   English

在shell脚本中运行时,Composer安装错误

[英]Composer install error when run in shell script

I have shell script for that is executed before start of the application. 我有一个shell脚本,它在应用程序启动之前执行。 This is the shell script 这是shell脚本

#!/bin/sh
/usr/local/bin/composer install
/usr/local/bin/php artisan optimize
/usr/local/bin/php artisan key:generate

when i try to execute this script i get this error 当我尝试执行此脚本时,我收到此错误

Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted


[Symfony\Component\Console\Exception\CommandNotFoundException]
 " is not defined.
 Did you mean this?
   install

The composer executable is installed and works when called from the command line 作曲家可执行文件已安装并在从命令行调用时可以正常工作

The trick is putting it like this 诀窍就是这样

#!/bin/sh
`/usr/local/bin/composer install`
`/usr/local/bin/php artisan optimize`
`/usr/local/bin/php artisan key:generate`

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM