Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  12] [ 6]  / answers: 1 / hits: 45126  / 11 Years ago, mon, november 25, 2013, 12:00:00

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?


More From » php

 Answers
14

  • download the PhantomJS binary, upload it somewhere and make it executable (chmod +x)

  • if you are going to make screenshots, setup fontconfig (this is pretty specific to my config but the goal is to make sure to have at least some fonts on your system)

  • run the following in PHP:

    $response = exec('/path/to/phantomjs myscript.js');


[#74068] Sunday, November 24, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
magdalena

Total Points: 364
Total Questions: 101
Total Answers: 92

Location: Namibia
Member since Mon, Nov 14, 2022
1 Year ago
;