Comments (10)
I just saw that another user experienced the same issue and was able to resolve it:
Since chromium was installed on node_modules folder by npm install, the problem occurred me is UnhandledPromiseRejectionWarning: Error: spawn EACCES.
After investigation, I found that the chromium binary owned by someone who run composer install/npm install, with default mode 700 in my Ubuntu. but php scripts owned and run by others, www usually. I must change the owner and mode of executable binary manually.
from php-chrome-html2pdf.
Hi,
The version with the custom node path specified is definitely correct, as Shell Error 127 usually means that the program could not be found.
Then regarding the spawn EACCES
error, it looks like this is related to the host system, never saw it before. Your code works just fine for me. Some users have found that running npm install
(resp. composer install
for this library) without sudo and/or executing chmod 777 node_modules/puppeteer/.local-chromium/linux-[XXX]/chrome-linux/*
would resolve the issue.
If that doesn't help, you could try to install Puppeteer manually like this: npm i -g puppeteer --unsafe-perm
Hope this helps.
from php-chrome-html2pdf.
I think it comes down to running it on a VM.
If I take this code and run it with my Mac's command line via php index.php
, it will run as expected. Within a VM that mirrors the production environment, it does not work - that's where the spawn EACCES
error comes to play.
I think this must come down to a permissions issue with either Node or Composer on the VM, but I'm not sure where to start.
It's not a big deal though, I think this is edge-case stuff.
from php-chrome-html2pdf.
Maybe it's a Scotchbox related issue, on my custom Vagrant VM it's working fine. Have you tried the suggested fixes above?
from php-chrome-html2pdf.
ohhhhhh, that makes sense! Let me try that. Thanks!
from php-chrome-html2pdf.
ohhhhhh, that makes sense! Let me try that. Thanks!
have you found anything, because code is working in local machine but on aws deployment, its showing same error, have you got anything ?
from php-chrome-html2pdf.
@sawrubgupta have you resolved the issue on your end? I am unable to run it on my server as well
from php-chrome-html2pdf.
Yes, just install chrominium in your aws machine, if it is elasticbeanstalk you can use .ebextension file to install chrominium, if ec2 then install it manually
from php-chrome-html2pdf.
@sawrubgupta did you also have to play around with the permissions for the spiritix vendor folder or the node folder? Also did you end up having to use the setNodePath or is it commented out ultimately? I will give it a try thanks!
from php-chrome-html2pdf.
@sawrubgupta I have installed chromium however i am still getting the same shell error 127 if node path isn't specified and shell error 126 if node path is specified
from php-chrome-html2pdf.
Related Issues (20)
- Problem with page.waitFor HOT 1
- Headers displayed in PDF HOT 1
- Change content-disposition to attachment HOT 6
- Unable to install on Linux Server HOT 1
- Uncaught PHP Exception: Shell error: 133 HOT 4
- Shell error 127 on linux ECS aws server but works fine on local HOT 5
- Binary error HOT 1
- Failed to launch the browser process HOT 1
- Cookies are not sent to Server while fetching content of the URL HOT 1
- No images/css/assets on relative urls HOT 3
- CSS Issue unexpected identifier "font"
- Fatal error: Uncaught Spiritix\Html2Pdf\ConverterException: Binary error: # # Fatal error in , line 0
- [Upgrade] Replace eloquent/composer-npm-bridge by php-forge/foxy HOT 1
- Binary Error -> import getStdin from 'get-stdin'; ^^^^^^^^ SyntaxError: Unexpected identifier at Module._compile HOT 5
- Binary error: Puppeteer old Headless deprecation warning HOT 3
- pageNumber and totalPages are not displayed in footerTemplate HOT 3
- Feature request: Add Auto Height
- urls with "file://" get a "net::ERR_UNKNOWN_URL_SCHEME " error
- Landscape Option Not Working
- Bug: Parameter type mismatch in Converter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-chrome-html2pdf.