Uglify-JS won't run using shell_exec ()

My question is similar to this:

Nodejs -.node_libraries / for www-data

I tried all night to get php to execute uglifyjs. I tried:

die(shell_exec('NODE_PATH="/home/app/nodejs/node_modules/"; export NODE_PATH; uglifyjs -o /home/app/public_html/js/profile.min5.js /home/app/public_html/js/profile.js'));

      

and

die(shell_exec('node /home/app/nodejs/node_modules/uglify-js/bin/uglifyjs -o /home/app/public_html/js/profile.min33.js /home/app/public_html/js/profile.js'));

      

and many other crazy combinations, but nothing works. Everything works fine if I do it manually in the shell. Can anyone please help?

+3


source to share


1 answer


Have you tried looking at the following (I'll go for the obvious, since you didn't say you tried it already):

apache user / www-data is allowed access to / home / app: sometimes / home directories are closed (chmod 0700)

Is it safe_mode

on your server? On the command line, try:

php -i | grep safe_mode

      



Then look at the output:

phpinfo();

      

What version of PHP are you using (maybe it doesn't matter)?

+1


source







All Articles