Install PhantomJS on cPanel

This post will cover installing PhantomJS on cPanel with root access.

The documentation at http://phantomjs.org/build.html is all that is needed.

I am only blogging this to let others know it did not break my cPanel server.

1. Download and install the dependencies

I already had openssl-devel, make, gcc, abd gcc-c++

 

2. Download and unzip latest source code from http://phantomjs.org/download.html

 

3. Enter the phantomjs-2.0.0 directory and run ‘./build’;

 

You will see a notice saying it will 30 minutes to several hours. It only took about 20 minutes on my server.

When build completes and you are still in the phantomjs-2.0.0 directory, you can run ‘bin/phantomjs’ to test and you should get a prompt.

4. Create a symlink to put phantomjs in everyone’s path:

 

As stated in the documentation at

“This produces a build bin/phantomjs. This is an executable; it can be moved to a different directory (e.g. /usr/local/bin) or another machine.”

So you could just move it to /usr/bin as well.