Execute grunt task from PHP script

I want to execute a grunt task in a php script with exec('grunt')

, but I always get 127

back. Any other bash command is fine.

I even made grunt.sh with

#!/bin/bash
grunt

      

and tried to execute with help exec('grunt.sh')

, but it will get it as well 127

.

Any thoughts on this?

+3


source to share


1 answer


It worked with absolute paths up to node and grumbled. exec('/usr/local/bin/node /usr/local/bin/grunt')



(on OS X 10.10.4 - the paths differ on different OSs, of course)

0


source







All Articles