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


Step 2 Install QT

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

name= CentOS-$releasever - ATrpms
yum install qt47-devel qt47-webkit qt47-webkit-devel sqlite-devel

Step 3 Install Xvfb

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:


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


Comments are closed.