I want to execute PhantomJS from PHP on localhost.
Can any body explain how to execute PhantomJS from PHP and what package I should download from phantomjs.org?
I want to execute PhantomJS from PHP on localhost.
Can any body explain how to execute PhantomJS from PHP and what package I should download from phantomjs.org?
I recently published a project that gives PHP access to a browser. Get it here: https://github.com/merlinthemagic/MTS. Under the hood it relies on PhantomJS.
After downloading and setup you would simply use the following code:
chmod +x
)$response = exec('/path/to/phantomjs myscript.js');
There's actually a library called PHP PhantomJS, intended to make this easier for you!
Feature list :
Make sure, though, that your version of PhantomJS is compatible with your version of PHP PhantomJS: