Closed samdiamond closed 4 years ago
+1
I am facing the same issue. in my case the error signal is 5
Have you ever wondered why the smartest person in your class didn't become the most successful, or why someone who was 'just average' in academic exams went on to achieve great success in business, at work, in social life?
The missing link has now been identified as Emotional Intelligence, which is responsible for our success to a great extent. It is a much better predictor of success in various spheres of life unlike conventional ‘intelligence’ which predicts success only at academic exams and in some technical jobs.
Although the term "emotional intelligence" has come to mean many different things, it consists of two parts: emotion and intelligence. "Emotions" refer to the feelings a person has in a relationship. For example, if a person has a good relationship with someone else, that individual is happy; if the person is threatened, he or she is afraid. Intelligence, on the other hand, refers to the ability to process information and make decision with or about something. For example, one processes information and draws conclusions using language in the case of verbal intelligence, or does the same about how objects fit together in the case of spatial intelligence. In the case of emotional intelligence, one processes information related to emotions, or emotions assist one's thinking . That is, emotional intelligence, as measured by the EQiP, refers to the capacity to identify emotional signals, process emotions, manage emotions and use them effectively to manage relationships .
You should set the binary path in snappy.php config file to the binary in the vendor directory:
<?php
return array(
'pdf' => array(
'enabled' => true,
'binary' => base_path('vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64'),
'timeout' => false,
'options' => array(),
),
'image' => array(
'enabled' => true,
'binary' => base_path('vendor/h4cc/wkhtmltoimage-amd64/bin/wkhtmltoimage-amd64'),
'timeout' => false,
'options' => array(),
),
);
It might work for you.
+1
I got around this error by setting the 'disable-javascript' option to true. To be honest, I don't know how/why this fixed it for me, but I found that solution from here.
$pdf = PDF::loadHTML($html)
->setOption('disable-javascript', true)
->stream();
I've got the config/snappy.php binary path correctly to my wkhtmltopdf-amd64 and I've tried with that disable-javascript option and none of them worked. Anyone has more clues or opinions on about to solve this?
+1
+1
Also having this issue. None of the above has helped.
i have the sane issue. any help?
I have the same issue. However, the error is not consistent. Sometimes I get this error and sometimes the pdf gets created properly without the error.
Same issue here, none of the above worked. Any idea where to start, how to debug?
Is wkhtmltopdf-amd64 working from command line? In my case file wkhtmltopdf-amd64 was corrupted. I downloaded it again and it started working.
Hi. In case of HTML-2-PDF, our workaroud is to slightly change the font size:
body {
font-size: 14px;
}
body {
font-size: 13px;
}
body {
font-size: 15px;
}
Let's be honest: we do not know why...
stucking here
I got same issue..
Same issue here. However, just noticed that if I run ./wkhtmltopdf
via ssh (with or without parameters), I get Segmentation fault
error, so this probably has anything to do with Snappy in the end.
Sadly I'm forced to use shared hosting on this project, so that might affect things a bit. I've tried almost all versions of wkhtmltopdf already, and got confirmation from the hosting company that it should be ok to run wkhtmltopdf binary.
Same issue here. However, just noticed that if I run
./wkhtmltopdf
via ssh (with or without parameters), I getSegmentation fault
error, so this probably has anything to do with Snappy in the end. Sadly I'm forced to use shared hosting on this project, so that might affect things a bit. I've tried almost all versions of wkhtmltopdf already, and got confirmation from the hosting company that it should be ok to run wkhtmltopdf binary.
I finally got rid of Segmentation fault
error by asking my hosting which version should 100% work on their CloudLinux - 0.10.0_rc2-static-amd64 they answered, and via SSH it actually fully works!
However, still having this signal error, raised in symfony/process/Process.php
.
First it was signal '11'
but after giving 0777 permissions for wkhtmltopdf, it changed to signal '4'
error.
EDIT:
In my case, these errors are caused by header-html
, however the content of header html does not matter. And for some reason every second error is signal 11
and every second is signal 4
. Any ideas what might cause this?
If I just ->setOption('header-html', 'testing')
, it works. But if I use url('template_header')
instead (doesn't matter what that file contains), it breaks down. In my dev environment (XAMPP with more recent version of wkhtmltopdf) everything works, but in shared hosting with 0.10.0_rc2 wkhtmltopdf this happens.
EDIT2 - solved:
Using view()->make('templates.header_template')->render()
instead of url('template_header')
(eventhough my routing, naming, etc is correct) seems to work when getting the header html! My css ain't working at all though, but it's most likely not related to this problem.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any issues with PDF rendering itself that are not directly related to this package, should be reported on https://github.com/KnpLabs/snappy instead. When having doubts, please try to reproduce the issue with just snappy. If you believe this is an actual issue with the latest version of laravel-snappy, please reply to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.
Same issue here. However, just noticed that if I run
./wkhtmltopdf
via ssh (with or without parameters), I getSegmentation fault
error, so this probably has anything to do with Snappy in the end. Sadly I'm forced to use shared hosting on this project, so that might affect things a bit. I've tried almost all versions of wkhtmltopdf already, and got confirmation from the hosting company that it should be ok to run wkhtmltopdf binary.I finally got rid of
Segmentation fault
error by asking my hosting which version should 100% work on their CloudLinux - 0.10.0_rc2-static-amd64 they answered, and via SSH it actually fully works! However, still having this signal error, raised insymfony/process/Process.php
. First it wassignal '11'
but after giving 0777 permissions for wkhtmltopdf, it changed tosignal '4'
error.EDIT: In my case, these errors are caused by
header-html
, however the content of header html does not matter. And for some reason every second error issignal 11
and every second issignal 4
. Any ideas what might cause this? If I just->setOption('header-html', 'testing')
, it works. But if I useurl('template_header')
instead (doesn't matter what that file contains), it breaks down. In my dev environment (XAMPP with more recent version of wkhtmltopdf) everything works, but in shared hosting with 0.10.0_rc2 wkhtmltopdf this happens.EDIT2 - solved: Using
view()->make('templates.header_template')->render()
instead ofurl('template_header')
(eventhough my routing, naming, etc is correct) seems to work when getting the header html! My css ain't working at all though, but it's most likely not related to this problem.
Sorry to answer this post so late, but I'm experiencing the same problem using CloudLinux. Did you manage to solve? How is your snappy.php configuration?
Replace assset() with public_path() in views solved the problem to me
for me, the solution was to download and install wkhtmltopdf
from here instead of using the composer dependency.
I'm using Centos 8
I had this issue while running laravel v9, laravel-snappy v1, phpunit v9 with Alpine Linux in gitlab CI. I was able to fix it by install some dependencies by changing the following in gitlab-ci.yml, from:
- apk add --no-cache wkhtmltopdf
to:
- apk add --no-cache wkhtmltopdf xvfb ttf-dejavu ttf-droid ttf-freefont ttf-liberation
I derived this solution from https://sasablagojevic.com/setting-up-wkhtmltopdf-on-docker-alpine-linux
I had this issue while running laravel v9, laravel-snappy v1, phpunit v9 with Alpine Linux in gitlab CI. I was able to fix it by install some dependencies by changing the following in gitlab-ci.yml, from:
- apk add --no-cache wkhtmltopdf
to:- apk add --no-cache wkhtmltopdf xvfb ttf-dejavu ttf-droid ttf-freefont ttf-liberation
I derived this solution from https://sasablagojevic.com/setting-up-wkhtmltopdf-on-docker-alpine-linux
This worked - kept me struggling for hours. Thank you!
Replace assset() with public_path() in views solved the problem to me
Thank you, my problem is solved with this solution
public_path
I dont have asset()
Here is how i solved this error on Almalinux 8,
I downloaded the x86_64 version from https://wkhtmltopdf.org/downloads.html and uploaded it to the server and installed with the command sudo dnf install -y <full_name_of_uploaded_file>
, after installation run which wkhtmltopdf
to get the installation path, it is usually /usr/local/bin/wkhtmltopdf
, from here on you can add this path as environment variable and reference it within the snappy.php config file as the binary path. Hopefully this helps someone, thank you
OS: CentOS Linux 7.0.1406 Laravel 5.1
Hi,
I have installed wkhtmltopdf directly and it runs fine from the command line.
However, when using this package I get the following error (truncated to the first few lines):
These files are never written to the /tmp/ directory - it has drwxrwxrwt permissions, and I can write to this directory from the command line with wkhtmltopdf.
The controller function is set up very simply, and the correct variables are being passed according to the error logs:
The snappy.php config file is pointing correctly to usr/local/bin/wkhtmltopdf.
Any help or guidance would be greatly appreciated!