[英]How to run a php file from bash script?
I am working in a Windows machine. 我正在Windows机器上工作。 I need to run a script that will execute a php file.
我需要运行将执行php文件的脚本。 When I run where php to find my php executable location I get the following:
当我在哪里运行php来找到我的php可执行位置时,我得到以下信息:
c:\\xampp\\php\\phpe.exe C:\\ XAMPP \\ PHP \\ phpe.exe
After that I tried something like this: 在那之后,我尝试了这样的事情:
#!/bin/bash
#!/c:/xampp/php c:/xampp/htdocs/Bash/testingphp.php
I don't get any error, but I don't know if the script is doing something. 我没有收到任何错误,但是我不知道脚本是否正在执行某些操作。 Just for reference I am using cygwing to run the scripts.
仅供参考,我正在使用cygwing运行脚本。 How do I know if my script is really working??
我怎么知道我的脚本是否真的有效?
Thank you in advanced 谢谢高级
As stated by @Etan, your second line is a comment, but your paths are also incorrect. 如@Etan所述,您的第二行是注释,但您的路径也不正确。 You need to use
/cygdrive/c/
, not /c:/
. 您需要使用
/cygdrive/c/
,而不是/c:/
。 Here is the corrected script: 这是更正的脚本:
#!/bin/bash
/cygdrive/c/xampp/php /cygdrive/c/xampp/htdocs/Bash/testingphp.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.