I'm on a Windows platform, I have the phantomjs executable on app/webroot/phantomjs and a js in the same folder. When I do on php:
$response = exec($this->webroot . 'app/webroot/phantomjs/phantomjs getweb.js');
nothing happens. This is the content of the js:
console.log('Hello, world!');
phantom.exit();
I use absolute paths because this needs to be executed on a webpage online.
EDIT 1:
when using
$response = exec($this->webroot . 'app/webroot/phantomjs/phantomjs getweb.js 2>&1', $s, $o);
echo $response;
echo "<pre>";
print_r($s);
echo "</pre>";
echo "<pre>";
print_r($o);
echo "</pre>";
I get
Array
(
)
1
EDIT 2:
this works fine:
echo exec("whoami");
EDIT 3: This does nothing:
$response = exec($this->webroot . 'app/webroot/phantomjs/phantomjs getweb.js 2>&1', $s, $o);