문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top