Skip to content

Instantly share code, notes, and snippets.

@dominicsayers
Last active November 21, 2016 01:59
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save dominicsayers/5736130 to your computer and use it in GitHub Desktop.
Save dominicsayers/5736130 to your computer and use it in GitHub Desktop.
Installing PhantomJS on Ubuntu

(updated version of http://www.joyceleong.com/log/installing-phantomjs-on-ubuntu/)

  1. export P=phantomjs-2.1.1-linux-x86_64
  2. cd /usr/local/share
  3. sudo curl -L -o $P.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/$P.tar.bz2
  4. sudo tar xvf $P.tar.bz2
  5. sudo ln --force -s /usr/local/share/$P /usr/local/share/phantomjs
  6. sudo ln --force -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
  7. phantomjs --version
@fayeyen
Copy link

fayeyen commented Oct 9, 2016

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

@fayeyen
Copy link

fayeyen commented Oct 9, 2016

ln: illegal option -- -
usage: ln [-Ffhinsv] source_file [target_file]
ln [-Ffhinsv] source_file ... target_dir
link source_file target_file

so I use
sudo ln -s /usr/local/share/$P /usr/local/share/phantomjs
without --force
in step 5 and 6
then when I run
step 7.
error
-bash: /usr/local/bin/phantomjs: cannot execute binary file

pls help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment