doujiyong7604 2014-07-18 16:10
浏览 183

如何从bash脚本运行php文件?

I am working in a Windows machine. I need to run a script that will execute a php file. When I run where php to find my php executable location I get the following:

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. How do I know if my script is really working??

Thank you in advanced

  • 写回答

1条回答 默认 最新

  • duanke1286 2014-08-24 18:23
    关注

    As stated by @Etan, your second line is a comment, but your paths are also incorrect. You need to use /cygdrive/c/, not /c:/. Here is the corrected script:

    #!/bin/bash
    /cygdrive/c/xampp/php /cygdrive/c/xampp/htdocs/Bash/testingphp.php
    
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!