Laravel- Dompdf Maximum execution time of 60 secon

2020-03-30 04:16发布

问题:

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

回答1:

Increase Your time limit in your controller file.Below variable to increase your time limit.

 set_time_limit(300);


回答2:

The laravel - dompdf does not work well with php artisan serve. You should use XAMPP or another HTTP server you like.



回答3:

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.



回答4:

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