Phantomjs error: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file

Error: When running phantomjs command:

error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

Cause: Missing libfontconfig.so.1

Solution:

Centos:

sudo yum install fontconfig

Ubuntu:

sudo apt-get install libfontconfig1