に行くと/fileDownload
、500 Internal Server Error - RuntimeException が表示されます:
「0」シグナルのため、プロセスが停止しました。
コントローラーのアクション:
public function fileAction()
{
$html = $this->render('MyBundle:Downloads:file.html.twig', array(
'fileNumber' => '1234'
));
return new Response(
$this->get('knp_snappy.pdf')->getOutputFromHtml($html),
200,
array(
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="file.pdf"'
)
);
}
WKHTMLTOPDF の端末コマンドを使用したところ、PDF が正常に生成されました。Symfony2 アプリでは機能しません。
私のconfig.ymlでは:
knp_snappy:
pdf:
enabled: true
binary: /usr/local/bin/wkhtmltopdf
options: []