Home > Dev Tools | Development | General > Phantom JS on Centos5

Phantom JS on Centos5

I spent the last 3 hours jumping through burning hoops of Linux fun to get Phantom JS installed on my Centos5 (64) system running in Virtual Box.

Step 1 Install GIT

http://angry-fly.com/2009/03/installing-git-on-centos-5/

Step 2 Install QT

Add this to /etc/yum.repos.d/CentOS-Base.repo

#ATrpms
[atrpms]
name= CentOS-$releasever - ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing
gpgcheck=1
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
enabled=1
yum install qt47-devel qt47-webkit qt47-webkit-devel sqlite-devel

Step 3 Install Xvfb
http://code.google.com/p/phantomjs/wiki/XvfbSetup

Step 4 Install Phantom JS

Be aware that the install process installs the program in the directory that it was downloaded to. Typically I download source code to /root/downloads. Then I do the build process which normally installs the program to some other location in the file system. Not so with this. So make sure to do the git clone step in the location where you want it installed.

git clone git://github.com/ariya/phantomjs.git
/usr/lib64/qt47/bin/qmake-qt47 && make

The last step is to add the phantomjs/bin to your path.

1. open the file: /home/<your-home-dir>/.bashrc
2. insert the path to the phantomjs/bin directory into the PATH variable. Mine looks like this:

PATH=/usr/local/phantomjs/bin/:/usr/local/mongodb/bin:/usr/local/node/bin:$PATH:$HOME/bin

3. Restart your shell and you should be good to go.

,

Comments are closed.

TOP