0
wkhtmltopdf를 사용하여 html 파일을 pdf로 변환하려고합니다. 명령 행에서 사용할 때 올바르게 작동하지만 PHP와 통합하려고하면 작동하지 않습니다.wkhtmltopdf가 PHP와 통합되어 있지 않습니다.
?>echo exec('whoami');
<?php
echo exec('whoami');
$cd = "cd C:/www/genpdf";
exec($cd);
$command = "C:/Program Files (x86)/wkhtmltopdf/wkhtmltopdf -O landscape C:/www/genpdf/index-5.html C:/www/genpdf/index-5.pdf";
exec($command);
if (file_exists("C:/www/genpdf/index-5.pdf")) {
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="index-5.pdf"');
readfile("C:/www/genpdf/index-5.pdf");
}
else {
echo "error";
}
나에게 nt authority\бЁбвҐ
라인
을 표시하고 나는 error
브라우저에서 선없이 PDF 파일을 얻을.
무엇이 잘못 되었나요?
시스템 명령이 PHP 스크립트에서 작동하는지 어떻게 확인할 수 있습니까? 어떤 명령을'exec' 대신에 사용해야합니까? –
"exec"대신 "system"명령을 사용할 수 있습니다 –
"safe_mode"설정이 활성화되어 있는지 여부는 php_ini –