I am trying to run PhantomJS from a PHP script using
exec('/path/to/phantomjs/phantonjs --version');
This line works fine from the CLI but does not work at all from my PHP script.
I have searched around for a fix and found this Q/A and read something about permissions that can be the problem. I have try all these fixes and still, PhantomJS does not launch.
I'm desperate at this point, can someone help me out? Thanks.
echothe returned value.execto work using the interactive interpreter usingphp -a?/usr/local/bin. The binary is executable and I have both permissions and ownership. I use a script as simple as$cmd = '/usr/local/bin/phantomjs --version';This obviously works flawlessly from the CLI but when called from PHP with:$response = exec($cmd, $out, $status) ;The status returnstruemeaning the command was not executed and both$responseand$outare empty. Notnullbut respectively an empty string and an array of strings with one empty string element.