Compiling PhantomJS 1.5 on Webfaction

Webfaction is a cool web host because they allow you to compile source code and run custom binaries.  One example of when this might be useful is to run PhantomJS.  Normally, you would download and install the pre-compiled version as described in an earlier post, but I ran into a bug the other day that was fixed in trunk and I couldn't wait for 1.5.1 to be released so I compiled PhantomJS on Webfaction myself and thought I'd share it in case it's useful for anyone else:

mkdir -p $HOME/src

cd $HOME/src

wget ''
tar -xzf chrpath-0.13.tar.gz
cd chrpath-0.13

mkdir build

./configure --prefix=$HOME/src/chrpath-0.13/build

make && make install

cp $HOME/src/chrpath-0.13/build/bin/chrpath $HOME/bin

cd $HOME/src

git clone git:// && cd phantomjs
git checkout 1.5

cp $HOME/src/phantomjs/bin/phantomjs $HOME/bin

To test:

phantomjs --version


Popular Posts