![]() |
unable to execute phantomjs from within my CI3 app - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: unable to execute phantomjs from within my CI3 app (/showthread.php?tid=80725) |
unable to execute phantomjs from within my CI3 app - richb201 - 12-09-2021 I am using koolreport. Koolreport is trying to run phantomjs but it fails with this error: Type: Exception Message: Could not execute phantomjs Filename: /app/vendor/koolreport/export/Handler.php Line Number: 67 My application is using Docker. Koolreport techS told me to try to run the example code that comes with phantomjs. I did this from the CLI and it runs fine. I have also tried changing the permissions of the phantomjs file. But the files is not found. ubuntu@ip-172-31-66-201:~/rst/RST/app/vendor/koolreport/export/bin$ sudo chmod +x app/vendor/koolreport/export/bin/phantomjs chmod: cannot access 'app/vendor/koolreport/export/bin/phantomjs': No such file or directory I know it is there because I can see it. ubuntu@ip-172-31-66-201:~/rst/RST/app/vendor/koolreport/export/bin$ ls phantomjs Can anyone tell me what is going on? RE: unable to execute phantomjs from within my CI3 app - includebeer - 12-09-2021 Your chmod command is wrong. You are in ~/rst/RST/app/vendor/koolreport/export/bin and then you then you try to change permission of a file in app/vendor/koolreport/export/bin/phantomjs. The OS is right, it doesn't exist. Try sudo chmod +x phantomjs. ...but the question remains, since when a javascript file needs to be executable? This doesn't make any sense. It's not a binary file containing an executable program, it's just a text file. I should be readable by the web server, not executable. That's an unnecessary security risk. RE: unable to execute phantomjs from within my CI3 app - richb201 - 12-15-2021 Thanks. I ended up adding the path to ~/export/bin to my path and now when I try to run I get the string that should run (see below). And when I run it from the cli I get: ubuntu@ip-172-31-66-201:~$ phantomjs --ignore-ssl-errors=true /app/vendor/koolreport/export/pdf/pdf.js /tmp/61b9eeb9320de2.tmp /tmp/61b9eeb9322f93.pdf eyJmb3JtYXQiOiJBNCIsIm9yaWVudGF0aW9uIjoicG9ydHJhaXQiLCJleHBlY3RlZExvY2F0aW9uIjoiaHR0cDpcL1wvc3RhZ2luZy5kYXNoYm9hcmQucmVzZWFyY2hzdHVkeW9ubGluZS5jb21cL2luZGV4LnBocFwvQ29uZmlndXJlXC9leGVjdXRpdmVfc3VtbWFyeSIsInJlc291cmNlV2FpdGluZyI6MTAwMH0= Can't open '/app/vendor/koolreport/export/pdf/pdf.js' So do I need to add another path? RE: unable to execute phantomjs from within my CI3 app - includebeer - 12-19-2021 The path is wrong in your command. According to your previous post, the app folder is in ~/rst/RST/, not in / (the root of the file system). So your command should be something like this: phantomjs --ignore-ssl-errors=true ~/rst/RST/app/vendor/koolreport/export/pdf/pdf.js ... |