KoolReport's Forum

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

Shell_exec phantomjs export #2210

Open Alejandro Olivares opened this topic on on Jul 15 - 2 comments

Alejandro Olivares commented on Jul 15

What I need is to know if there are any required php parameters so that I can freely execute the php shell_exec command.

Since this command needs to access files from the server, but it only works in php unsafe mode.

I get the error "Could not execute phantomjs" which is because the command called by shell_exec cannot be executed

I even tried using the phantomjs.exe, but it is a linux server

Sebastian Morales commented on Jul 16

Alejandro, you would have to assign executable permission to the Linux binary phantomjs file (which could be downloaded from phantomjs website) for your web server user. You could find out your web server user with this php code:

<?php echo exec('whoami'); ?>
MvdHII commented on Sep 13

I am getting the same Error "Cannot execute phantomjs" but I'm on Windows 10 running XAMPP server. I have gone through this forum extensively, still can't get it to work. I can see the PhantomJs.exe show up in the Task manager (from koolreport/export/bin) I have checked the permissions, checked the php.ini for disabled_functions, it just hangs the export. It does generate the tmp file correctly.... If I close task it releases the export but does not generate the pdf. XAMPP 3.3.0 PHP 7.4.22 PhantomJS 2.1.1. What else should I be looking into?

FOUND THE SOLUTION...on this forum

This is a known issue when phantomjs working with built-in php web server (php -S). We are still testing below solution. Please locate the file "koolreport/export/Handler.php", look for this line in pdf() method

$params["expectedLocation"] = $this->getFullUrl(); and you change to

$params["expectedLocation"] = str_replace("http://","",$this->getFullUrl()); This solution will be implemented in next version of export package when we are done with testing.

Please reverse to us if above solution is working.

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

Export