Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用shell脚本(.sh文件)执行web路由_Php_Bash_Shell_Cron_Script - Fatal编程技术网

Php 如何使用shell脚本(.sh文件)执行web路由

Php 如何使用shell脚本(.sh文件)执行web路由,php,bash,shell,cron,script,Php,Bash,Shell,Cron,Script,我有一个像这样的.sh文件 #!/bin/bash /usr/bin/curl --silent http://localhost/naufal/test/kms/cli/runEmail >/dev/null 2>&1 该脚本工作正常,但我希望shell脚本使用目录文件夹而不是curl来执行cli/runEmail路由 所以,我尝试了这个脚本 #!/bin/bash cd /Applications/XAMPP/xamppfiles/htdocs/NAUFAL/TEST/

我有一个像这样的.sh文件

#!/bin/bash
/usr/bin/curl --silent http://localhost/naufal/test/kms/cli/runEmail >/dev/null 2>&1
该脚本工作正常,但我希望shell脚本使用目录文件夹而不是curl来执行cli/runEmail路由

所以,我尝试了这个脚本

#!/bin/bash
cd /Applications/XAMPP/xamppfiles/htdocs/NAUFAL/TEST/kms

/usr/bin/php index.php cli runEmail >/dev/null 2>&1
但这不管用,有什么办法吗

*注意:我使用MacOs Mojave

“我希望shell脚本使用目录文件夹执行cli/runEmail路由”-您能澄清这是什么意思吗?“但那不起作用”-为什么不,发生了什么<代码>>/dev/null 2>&1隐藏任何输出和错误-您是否尝试删除这些内容以便查看实际发生的情况?