我使用wkhtml2pdf生成pdf文件,本地二进制文件工作正常,但我不知道为什么我在部署到heroku时遇到此问题.我收到这个错误
退出状态代码'127'表示出错了:stderr:"/ app/vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64:加载共享库时出错:libjpeg.so.8:无法打开共享对象文件:没有这样的文件或目录"stdout:""
我的composer.json包含了我需要的这3个文件
"h4cc/wkhtmltopdf-amd64": "0.12.x",
"h4cc/wkhtmltoimage-amd64": "0.12.x",
"barryvdh/laravel-snappy": "0.1.x"
Run Code Online (Sandbox Code Playgroud)
snappy是处理wkhtml2pdf二进制文件的类.
Snappy已正确配置为从vendor文件夹加载二进制文件
'pdf' => array(
'enabled' => true,
'binary' => base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'),
'options' => array(),
),
'image' => array(
'enabled' => true,
'binary' => base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'),
'options' => array(),
),
Run Code Online (Sandbox Code Playgroud)
但问题是,当我试图生成PDF,在那一刻我打电话wkhtml2pdf它具有约libjpeg.so.8的错误是什么我一无所知停止.
用户架构
public function up()
{
Schema::table('users', function($table)
{
$table->create();
$table->increments('id');
$table->string('email');
$table->string('real_name');
$table->string('password');
$table->timestamps();
});
}
Run Code Online (Sandbox Code Playgroud)
Dni 架构
public function up()
{
Schema::table('dnis', function($table){
$table->create();
$table->increments('id');
$table->integer('user_id');
$table->string('numero',15);
$table->timestamps();
});
}
Run Code Online (Sandbox Code Playgroud)
我有这些模型
User:
<?php
class User extends Eloquent
{
public function setPassword($string)
{
$this->setAttribute('password', Hash::make($string));
}
public function dni()
{
return $this->hasOne('Dni', 'user_id');
}
}
Run Code Online (Sandbox Code Playgroud)
日夜
<?php
class Dni extends Eloquent
{
public function user()
{
return $this->belongsTo('User');
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试
public function getIndex()
{
$users = User::all();
return View::make('users.index') …Run Code Online (Sandbox Code Playgroud)