S
S
SiDChik2014-08-04 10:05:07
PHP
SiDChik, 2014-08-04 10:05:07

How to run grunt from php side?

I need to rebuild the package using grunt for a certain action. But the bonus exec('grunt') doesn't help. Can you tell me how else to try?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vit, 2014-08-04
@fornit1917

> But bonalny exec ('grunt') does not rescue.
So you are doing something wrong. Must save. Write in more detail what is the problem with exec.

D
Dmitry, 2014-10-05
@dmkuznetsov

Probably a question in environment variables.
Try
putting putenv('PATH=' . getenv('PATH') . ':/usr/local/bin'); at the beginning of the script;
And your script will know to look for node in /usr/local/bin. Well, or where you specify

K
krinbin, 2019-01-30
@krinbin

var_dump(shell_exec('cd /path/to/local/grunt/project/ && /usr/local/bin/node /usr/local/bin/grunt 2>&1'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question