Created
July 19, 2019 19:24
-
-
Save edwardsharp/2595abf2dac70f898d6f0eb058132436 to your computer and use it in GitHub Desktop.
PhantomJS installer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script will install PhantomJS on a Debian/Ubuntu System | |
# | |
# This script must be run as root: | |
# sudo sh install_phantomjs.sh | |
# | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
PHANTOM_VERSION="phantomjs-2.1.1" | |
ARCH=$(uname -m) | |
if ! [ $ARCH = "x86_64" ]; then | |
$ARCH="i686" | |
fi | |
PHANTOM_JS="$PHANTOM_VERSION-linux-$ARCH" | |
#apt-get update | |
apt-get install build-essential chrpath libssl-dev libxft-dev -y | |
apt-get install libfreetype6 libfreetype6-dev -y | |
apt-get install libfontconfig1 libfontconfig1-dev -y | |
cd ~ | |
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 | |
tar xvjf $PHANTOM_JS.tar.bz2 | |
mv $PHANTOM_JS /usr/local/share | |
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment