0
내 코드에 문제가 있습니다. 이 같은PHP exec 명령 pdftoimage가 작동하지 않습니다.
내 코드 조회 : 그것을 실행하기 전에
$destinationFolder = $destinationRootFolder . '/';
// mkdir($destinationFolder,777);
$options = $this->buildOptions($saveAsJpeg, $inputPdf, $destinationFolder);
print_r($options);
// exit;
try {
$command = "/usr/bin/pdfimages ".$options[0]." ".$options[1]." ".$options[2];
echo $command;
// exit;
shell_exec($command);
exec($command);
// $command;
// echo $r;
} catch (ExecutionFailureException $e) {
throw new RuntimeException('PdfImages was unable to extract images', $e->getCode(), $e);
}
코드는 첫 번째 명령을 입력했습니다. 콘솔에 복사 명령이 잘 작동하지만 PHP 파일 png를 만들지 않습니다.
편집
[email protected]:~# php -a
Interactive mode enabled
php > ls
php > exec("/usr/bin/pdfimages -png /path/pdf/file.pdf /tmp/savefile/")
php > shell_exec("/usr/bin/pdfimages -png /path/pdf/file.pdf /tmp/savefile/")
php >
또한, 아파치가 그것을 실행할 수있는 권한이없는 것 소리
편집 할 수 있습니까? – bradley546994
var_dump (exec ("/ usr/bin/pdfimages -png /path/pdf/file.pdf/tmp/savefile /")); 출력 –
this : string (0) "" – bradley546994