Reputation: 145
Here is error when i convert pdf, it's not working since i run my laravel project by "php artisan serve --port=1000
". But if i run my laravel project with xampp. it's alright. I don't know why?. Give me explaination and repairs . Thank you
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Maximum execution time of 60 seconds exceeded
Upvotes: 9
Views: 35185
Reputation: 21
Don't use Bootstrap or any external CSS for your printable PHP file. as well as don't use any internal CSS for this.
Upvotes: 0
Reputation: 31
use public_path for your external files for exe href="{{public_path('style.css')}}"
Upvotes: 3
Reputation: 220
What I found was referencing to assets via asset()
helper in the PDF view was throwing timeout exceeded error, I changed it to public_path()
and it started working fine.
Upvotes: 10
Reputation: 192
dompdf does not work on
php artisan server
You should go through xampp server. It solved my problem
Upvotes: 2
Reputation: 664
For me, there were two main issues.
storage_path()
so, I first convert image to base64 and pass it to the blade view.<style>..</style>
These steps make the PDF generation process very fast.
Upvotes: 3
Reputation: 186
The laravel - dompdf does not work well with php artisan serve
. You should use XAMPP or another HTTP server you like.
Upvotes: 15
Reputation: 11
Possible causes:
linking to external CSS - you're better off writing your css between style tags in the same file as your html
using blade templating syntax e.g. @sections @roles, etc
linking to external images
Complex table structures/layouts
...from personal experience
Upvotes: 1
Reputation: 164
I had the same problem and narrowed it down to linking to an image in my blade file. When I embedded the image instead as per this SO answer, it no longer timed out.
Upvotes: 1
Reputation: 21681
Increase Your time limit in your controller file.Below variable to increase your time limit.
set_time_limit(300);
Upvotes: 8