KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Export pdf doesn't work #2174

Open Epitello opened this topic on on Jun 30, 2021 - 7 comments

Epitello commented on Jun 30, 2021

Hello team, i try to export a report to pdf but i get an error : "could not excute phantomjs", i'am using koolreport with symfony. I searched and when i try to execute the $command code in command prompt i get this error : "/var/www/osf-stat/vendor/koolreport/export/bin/phantomjs --ignore-ssl-errors=true /var/www/osf-stat/vendor/koolreport/export/pdf/pdf.js /tmp/60dc98caaa5872.tmp /tmp/60dc98caaa5ca3.pdf eyJmb3JtYXQiOiJhNCIsIm9yaWVudGF0aW9uIjoicG9ydHJhaXQiLCJ6b29tIjoxLjI1LCJkcGkiOjMwMCwiZXhwZWN0ZWRMb2NhdGlvbiI6Imh0dHA6XC9cLzE5Mi4xNjguMS41OFwvaW5kZXgucGhwXC9zdGF0c1wvZG9jdW1lbnRcLzM2XC9leHBvcnQ/ZXhwb3J0VHlwZT1wZGYmaWRFbnQ9MSIsInJlc291cmNlV2FpdGluZyI6MTAwMH0= Auto configuration failed 140404409081472:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou dossier de ce type 140404409081472:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244: 140404409081472:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=ssl_conf, path=ssl_conf 140404409081472:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=ssl_conf"

and i i add OPENSSL_CONF=/etc/ssl before i get another error : "source file not found"

i need your help

$report

                ->run()

                ->export('ExportPDF')

                ->pdf([

                    "format" => $params['document']['format'],

                    "orientation" => $params['document']['orientation'],

                    "zoom" => 1.25,

                    'dpi' => 300

                ])

                ->toBrowser('myreport.pdf', true);

Thanks by advance

Sebastian Morales commented on Jul 1, 2021

There might be some problem with your PhantomJS installation. Pls install PhantomJS for your operating system to this path koolreport/export/bin/ and make sure to be able to run these standard tests:

https://phantomjs.org/screen-capture.html

Epitello commented on Jul 8, 2021

Looks like it's a problem with Apache and rights. I have run an example without apache and it works perfectly. But in the code with Apache I modified the user to get the same as the example without Apache and it still doesn't work. If I copy the "$command" and run it in a terminal it works fine, but when I run it with "shell_exec" the "$result" is "NULL". Do you already have a similar problem? thank you in advance

Epitello commented on Jul 8, 2021

i'am under linux system. Btw on windows it's working perfectly

Epitello commented on Jul 8, 2021

i have try to excute another script in the same folder and it's work, only phantomjs doesn't work

Sebastian Morales commented on Jul 8, 2021

Does this error message remain: could not load the shared library:dso_dlfcn.c:185:filename(libssl_conf.so): libssl_conf.so?

If it does you have a problem with your PhantomJS installation dependency on your Linux server. There're many Linux distros and version so you might want to find way to install PhantomJS for your distro and version. And pls remember to install its dependent libraries as well.

If PhantomJS is installed correctly and export still doesn't run let us know. Tks,

Epitello commented on Jul 8, 2021

No i don't have this message anymore, but i still get the "could not execute phantomjs" error and it's beacause the "$result" varaible in your file is always "NULL" but if i execute the "$command" generated string in console, it's work perfectly

Sebastian Morales commented on Jul 9, 2021

Ok, this might be a permission problem. Pls try to add executable permission to the phantomjs binary file for your PHP user. You could execute phantomjs in terminal with your login user but the PHP user might not be able to, thus the error. Rgds,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None