在php中使用shell_exec执行casper命令,获取对应的值,发现报错:No such file or directory; did you install phantomjs?
需要在php的执行前加入这么一段代码:
putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs");
$result = shell_exec("casperjs /test/tt.js");
echo $result;
在php中使用shell_exec执行casper命令,获取对应的值,发现报错:No such file or directory; did you install phantomjs?
需要在php的执行前加入这么一段代码:
putenv("PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs");
$result = shell_exec("casperjs /test/tt.js");
echo $result;