Reproducing:
- follow the installation instructions in T188745 with default limits set (300M memory)
- edit a wiki page and insert a <math>formula </math>
- press "show preview"
Result:
- //Mathoid cli /path/to/cli.js is not executable.// and no formula shown
Doing the same from CLI as the web server user worked:
```
sudo -H -u www-data bash -c 'php -r "echo exec(\"/path/to/mathoid/cli.js -c /path/to/mathoid/config.yaml\");"'
```
Expected:
- Error message: //Memory limit exhausted, please adjust $wgMaxShellMemory//
[[ https://github.com/wikimedia/mediawiki-extensions-Math/blob/25874698344e33f6512d817b33345876af5fb072/src/MathMathMLCli.php#L125 | `$result->getExitCode() != 0` ]] only indicates that something went wrong during execution.
Anytime, when execute mathoid/cli.js failed, only logging `Mathoid cli mathoid/cli.js is not executable` message ([logging point](https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Math/+/e81d53bc8eff52ccd240f3f17d4f8a89b69da01a/src/MathMathMLCli.php#132)). This will make operator messy, because the real reason is often not that the file is not executable, such as Nodejs throw an error or failed to execute shell command.
Logging error messages from STDERR at the same time would be better.