(updated version of http://www.joyceleong.com/log/installing-phantomjs-on-ubuntu/)
export P=phantomjs-2.1.1-linux-x86_64
cd /usr/local/share
sudo curl -L -o $P.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/$P.tar.bz2
sudo tar xvf $P.tar.bz2
sudo ln --force -s /usr/local/share/$P /usr/local/share/phantomjs
sudo ln --force -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
phantomjs --version
I followed the above 7 steps to install phantomjs the error show at step 7.
phantomjs --version
phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file o
r directory