在尝试使用SSLPassPhraseDialog时重新启动Apache时出现错误“无效的命令”echo“…”

使用另一个答案的解决scheme,我添加了以下到我的apacheconfiguration

SSLPassPhraseDialog exec:/path/to/passphrase-script 

在这个剧本中,我放置了这个:

 #!/bin/sh echo "put the passphrase here" 

现在,当我重新启动Apache,我得到以下错误:

 Invalid command 'echo', perhaps misspelled or defined by a module not included in the server configuration 

我应该在shell脚本中使用其他命令吗? 或者我需要configurationApache不同,所以回声命令的作品?

您的shell( /bin/sh )似乎不支持将echo作为内置命令,并且您的脚本可能是从没有有效的PATH环境variables集的环境中调用的。

使用echo命令的完整path(通常是/bin/echo ,有时候是/usr/bin/echo ),而事情应该起作用。