I put phantomjs-1.9.7-macosx and casperjs 1.1-beta into two separate folders. In the root directory I have index.html, where I'm calling hello.js which is a minimal scraping script from casparjs getting started example. Obviously I'm getting:
Uncaught ReferenceError: require is not defined
since require() does not exist in the browser/client-side.
Then I tried to set the environment with PHP and execute it
putenv("PHANTOMJS_EXECUTABLE=/phantomjs/bin/phantomjs");
echo "Running PhantomJS version: ";
echo exec('/phantomjs/bin/phantomjs --version 2>&1');
echo "Running CasperJS version: ";
echo exec('/casperjs/bin/casperjs --version 2>&1');
but the server responded with a new error:
Warning: exec() has been disabled for security reasons in
I couldn't find any workaround to that one, so I decided to do one step back and to run this on a local XAMPP web server. I followed the answer from a similar problem, but CasperJS responded with an error again:
[Errno 13] Permission denied; did you install phantomjs?
I tried "sudo chmod a+rx" for the directories, but with no success.
I cannot find solutions to any of my problems. I used these simple examples just to test. All of it run fine from the terminal (as well as PHP files on a local web server). The problem I believe, is in integration on the server, either local or web.