質問

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