Skip to content

PhantomJS installation

Thomas D edited this page Jan 10, 2017 · 4 revisions

Linux (Debian, Ubuntu, Kali)

  1. apt-get update && apt-get install phantomjs

Linux (other distributions)

  1. Get the latest phantomjs program. The current version was 2.1.1 at the time of writing this tutorial.
    http://phantomjs.org/download.html
    https://bitbucket.org/ariya/phantomjs/downloads

  2. Download it on your system (choose 32 or 64bits) and untar it wherever you want, let's say /opt
    $ cd /opt
    $ wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
    $ tar xvf phantomjs-2.1.1-linux-x86_64.tar.bz2

  3. Make a symlink to the phantomjs binary in your /usr/local/bin directory
    $ ln -s /opt/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs

  4. Execute the binary with the -v option to check that everything works
    $ phantomjs -v
    2.1.1

Windows

  1. Get the latest phantomjs program. The current version was 2.1.1 at the time of writing this tutorial.
    http://phantomjs.org/download.html
    https://bitbucket.org/ariya/phantomjs/downloads

  2. Download it on your system and untar it wherever you want, let's say C:\Program Files\phantomjs-2.1.1-windows

  3. Add C:\Program Files\phantomjs-2.1.1-windows to the PATH environment variable (user or system, whatever)

  4. Open a command prompt and execute the binary with the -v option to check that everything works
    phantomjs -v
    2.1.1

Clone this wiki locally