簡體   English   中英

從php腳本中執行grunt任務

[英]Execute a grunt task from within a php script

我想用exec('grunt')在php腳本中執行一個grunt任務,但我總是得到127 任何其他bash命令都可以。

我甚至做了一個grunt.sh

#!/bin/bash
grunt

並試圖通過exec('grunt.sh')執行,但也得到127回。

有什么想法嗎?

它使用了節點和grunt的絕對路徑。 exec('/usr/local/bin/node /usr/local/bin/grunt')

(在OS X 10.10.4上 - 當然不同操作系統的路徑不同)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM