In PHP running on Ubuntu, I can run exec('npm -v') and the output is good,
but I can't run exec('gitbook xxxx').
gitbook is a npm package I installed by
npm install gitbook -g
I can run gitbook xxxx in the Ubuntu terminal, how can I run it from my PHP code?
sudo -u www-data npm -g install gitbookand see if that worksbackticksso that it's clear which bits are the actual code and which bits are comments. Also capitalized words like PHP. Both to make it a little easier for the user to read. It might help if you add the execution results when you actually run the code.