Php dompdf图像未显示在刀片文件laravel中
每当我试图下载我的pdf文件时,我总是遇到这个错误,Php dompdf图像未显示在刀片文件laravel中,php,image,laravel,laravel-5.2,Php,Image,Laravel,Laravel 5.2,每当我试图下载我的pdf文件时,我总是遇到这个错误,超过了60秒的最大执行时间,我四处查看,大多数人都说要更改php.ini的最大执行时间。我已经这样做了,但仍然得到错误。我在xampp/php.ini文件夹中更改了它,不确定它是否正确。我试着在我的laravel项目下查找php.ini,但那里没有这样的文件。我尝试的另一件事是将ini\u设置为('max\u execution\u time',60)位于my blade.php的顶部,但仍然不起作用。有人能帮我吗?提前谢谢 test.blad
超过了60秒的最大执行时间,我四处查看,大多数人都说要更改php.ini的最大执行时间。我已经这样做了,但仍然得到错误。我在xampp/php.ini文件夹中更改了它,不确定它是否正确。我试着在我的laravel项目下查找php.ini,但那里没有这样的文件。我尝试的另一件事是将ini\u设置为('max\u execution\u time',60)代码>位于my blade.php的顶部,但仍然不起作用。有人能帮我吗?提前谢谢
test.blade.php
<?php ini_set('max_execution_time', 60); ?>
<div class="container">
@foreach($object as $test)
@if( $pdf == 0 )
<a href="{{url('/pdfview')}}{{$test->id}}">Download PDF</a>
@endif
@endforeach
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 2px solid black;
width: 60%;
}
</style>
</head>
<body>
<table align="center">
<tr>
<th>Designation</th>
<th>
@foreach($data3 as $currentUser)
<img src="{{ url('images/' . $currentUser->name ) }}">
@endforeach
</th>
</tr>
</table>
</body>
</html>
</div>
public function getBiodata($id){
$object = personal_info::where('id',$id)->get();
$object1 = additional_info::where('user_id',$id)->get();
$data3=UserImage::where('user_id',$id)->get();
$object4 = language::where('user_id',$id)->get();
$pdf = PDF::loadView('biodata', compact('id','object','object1','data3','object4'), array('pdf' => 1));
return view('biodata',compact('id','object','object1','data3','object4'),array('pdf' => 0 ));
}
testController://在test.blade.php中显示
<?php ini_set('max_execution_time', 60); ?>
<div class="container">
@foreach($object as $test)
@if( $pdf == 0 )
<a href="{{url('/pdfview')}}{{$test->id}}">Download PDF</a>
@endif
@endforeach
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 2px solid black;
width: 60%;
}
</style>
</head>
<body>
<table align="center">
<tr>
<th>Designation</th>
<th>
@foreach($data3 as $currentUser)
<img src="{{ url('images/' . $currentUser->name ) }}">
@endforeach
</th>
</tr>
</table>
</body>
</html>
</div>
public function getBiodata($id){
$object = personal_info::where('id',$id)->get();
$object1 = additional_info::where('user_id',$id)->get();
$data3=UserImage::where('user_id',$id)->get();
$object4 = language::where('user_id',$id)->get();
$pdf = PDF::loadView('biodata', compact('id','object','object1','data3','object4'), array('pdf' => 1));
return view('biodata',compact('id','object','object1','data3','object4'),array('pdf' => 0 ));
}
我已经完成了我的一个项目:-
更改为:-
<img src="{{ url('images/' . $currentUser->name ) }}">
name)}}>
致:-
name}}/>
希望有帮助!大多数PDF生成所需时间不会超过几秒钟(除非您有10k以上的页面;p),在修改服务器配置之前,请检查无限循环的代码。您是指具有forloop的部分吗?任何循环都需要查看代码,以进一步提供帮助。请在我更新问题Updated@LawrenceRone时,一定要等一下,它是否像此名称}}/“>?或者像这个名字}}”/>?对不起,我把它和结尾处的斜杠搞混了}}”/>删除你的img标签并加上我的建议对不起,我需要一些时间去测试它,我已经删除了上次的代码,所以我要重做again@Dkna好的,没有问题,你可以测试