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 >
また、Apacheはそれを実行する権限を持っていないようですね
編集できませんか? – bradley546994
var_dump(exec( "/ usr/bin/pdfimages -png /path/pdf/file.pdf/tmp/savefile /"))とは何ですか?出力 –
this:string(0) "" – bradley546994