0
私はtwifビューからPDFを生成する必要があります。 私はこれを試していますhttp://www.michaelperrin.fr/2016/02/17/generating-pdf-files-with-symfony/symfony 3でPDFを生成
しかし、私は問題があります。
マイconfig.yml
knp_snappy:
pdf:
enabled: true
binary: %kernel.root_dir%/../vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64
マイコントローラ:
$html = $this->render('order/pdf.html.twig');
$filename = sprintf('test-%s.pdf', date('Y-m-d'));
$response = new Response();
$response->setContent($this->get('knp_snappy.pdf')->generateFromHtml($html, '/home/xxx/domains/xxx.hekko.pl/public_html/web/pdf/test.pdf'));
$response->setStatusCode(Response::HTTP_OK);
$response->headers->set('Content-Type', 'application/pdf');
そして、私はエラー
[2016-07-10 14:54:02] request.CRITICAL: Uncaught PHP Exception RuntimeException: "The exit status code '127' says something went wrong: stderr: "sh: wkhtmltopdf: command not found " stdout: "" command: wkhtmltopdf --lowquality '/tmp/knp_snappy5782456ab8c340.15653998.html' '/home/xxx/domains/xxx.hekko.pl/public_html/web/pdf/test.pdf'."
何が問題になっていますがありますか?
私はホスティングを共有していますが、おそらくVPSが必要ですか?
バイナリパスを確認しましたか? config.ymlと同じですか? (多分それは64ビットバージョンではない) –