Trying to execute phantomjs from php

234 views Asked by At

Hello i'm having some troubles with phantomjs. Im trying execute a simple statement but im getting the same error over and over.

exec('../bin/phantomjs --version', $o, $r);
var_dump($r);

print_r($o);

im getting this:

int(2) Array ( [0] => ../bin/phantomjs: 1: ../bin/phantomjs: Syntax error: Unterminated quoted string )

What gives? Im on a mac and phantomjs have 777 rights.

1

There are 1 answers

3
Vaviloff On

It means there is a syntax error in your script, a missing " symbol somewhere. Check your script, for example here: http://esprima.org/demo/validate.html or in an editor with syntax validation and fix any errors found.

It's a good idea to also test PhantomJS script after changes from a console before running in any external service (like PHP).