-1

The following command, which generates a .pdf file from a .tex file, works from the command line but not when I run it with PHP. The file has the appropriate permissions and I'm able to run other commands with exec() so not sure what is going on.

$file_path='uploads/some-path';

$full_path='uploads/some-path/file.pdf';

$cmd ="pdflatex -output-directory ".$file_path.' '.$full_path;

exec($cmd);

The flag -output-directory place the file in the file_path rather than the root directory.

tim peterson
  • 23,653
  • 59
  • 177
  • 299

1 Answers1

2

Is pdflatex in the search path? Perhaps try specifying the full path to the executable and see if that makes a difference.

Zebra North
  • 11,412
  • 7
  • 37
  • 49