Git Product home page Git Product logo

Comments (10)

spiritix avatar spiritix commented on September 23, 2024 3

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.

spiritix avatar spiritix commented on September 23, 2024

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.

ethanbeyer avatar ethanbeyer commented on September 23, 2024

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.

spiritix avatar spiritix commented on September 23, 2024

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.

ethanbeyer avatar ethanbeyer commented on September 23, 2024

ohhhhhh, that makes sense! Let me try that. Thanks!

from php-chrome-html2pdf.

sawrubgupta avatar sawrubgupta commented on September 23, 2024

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.

codinglife456 avatar codinglife456 commented on September 23, 2024

@sawrubgupta have you resolved the issue on your end? I am unable to run it on my server as well

from php-chrome-html2pdf.

sawrubgupta avatar sawrubgupta commented on September 23, 2024

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.

codinglife456 avatar codinglife456 commented on September 23, 2024

@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.

codinglife456 avatar codinglife456 commented on September 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.