xelatex fails unless I re-set PATH to what it already is
问题 I have this PHP script: echo '--- getenv: ' . getenv('PATH') . "\n"; echo '--- echo PATH: ' . shell_exec('echo $PATH') . "\n"; echo '--- xelatex: ' . shell_exec('xelatex 2>&1') . "\n"; putenv('PATH='.trim(shell_exec('echo $PATH'))); echo '--- getenv: ' . getenv('PATH') . "\n"; echo '--- echo PATH: ' . shell_exec('echo $PATH') . "\n"; echo '--- xelatex: ' . shell_exec('xelatex 2>&1') . "\n"; Run from a php-fpm process (with clear_env = yes), it produces the following output: --- getenv: ---