我觉得我似乎完全缺少一些东西,但是无论如何我都在。我正在使用Snappy PDF通过foreach循环帮助为大约150个用户生成佣金存根的PDF。这是我第一次与Snappy合作,我似乎根本无法使用它。我不断收到此错误:
AbstractGenerator.php第336行中的RuntimeException:退出状态代码“ 127”表示出了点问题:stderr:“ sh:1:/ vendor / h4cc / wkhtmltopdf-amd64 / bin / wkhtmltopdf-amd64:未找到”标准输出:“”命令:/ vendor / h4cc / wkhtmltopdf-amd64 / bin / wkhtmltopdf-amd64 --lowquality'http://www.google.com''/var/www/web/choicepartners/htdocs/storage/commissions/test.pdf'。
if (count($rows))
{
$pdf = App::make('snappy.pdf.wrapper');
$pdf->generate('http://www.google.com', storage_path() . '/commissions/test.pdf');
}
这实际上是实现Snappy的所有代码。我的目录在正确的位置,并且我仔细检查了Github的安装说明,但没有成功。
任何在脑袋里告诉我我所缺少的东西都是祝福!
更改您的配置文件
'binary' => '/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64',
类似
base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'),
然后执行以下工匠命令
php artisan optimize:clear
php artisan config:cache
php artisan cache:clear
php artisan config:clear
php artisan config:cache