The call of command:
$dir = "/path/to/source/file";
exec("cd $dir;xelatex filesource.tex", $output_array[0]);
always fails, but:
$dir = "/path/to/source/file";
exec("cd $dir;/usr/texbin/xelatex -no-pdf filesource.tex", $output_array[0]);// now we have .xdv file
exec("cd $dir;/usr/texbin/xdvipdfmx filesource.xdv", $output_array[1]);
succeed, and result .pdf file absolutely valid. What is the trick?
xelatex needs its "helpers" e.g xdvipdfmx executable to be in the PATH of the PHP environment