Important note

PhantomJS is dying

PhantomJS is lacking of so many features for mordern web browser, you may want to try Headless Chrome.

How to Install PhantomJS on Ubuntu 16.04 (for development)

http://phantomjs.org/download.html

tar xvjf ~/Downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C ~/opt/
ln -s ~/opt/phantomjs-2.1.1-linux-x86_64/bin/phantomjs ~/bin/
vim ~/.bashrc
PATH=$PATH:$HOME/bin

open a new terminal

$ phantomjs -v
2.1.1

centos 7

sudo yum install fontconfig -y

same as ubuntu 16.04

example projects

See also

References