Question

how to install phantomjs

Posted April 9, 2020 738 views
CentOSApache

Hi,
I already have downloaded the file “phantomjs-2.1.1-linux-x8664.tar.bz2” and upon executing this command: “tar xvf phantomjs-2.1.1-linux-x8664.tar.bz2” I get this: “tar: phantomjs-2.1.1-linux-x8664.tar.bz2: cannot open: No such file or directory”
When I do “ls”, this is what I see:
conf mail phantomjs-2.1.1-linux-x86
64.tar.bz2 temp web

So, I have it downloaded but I’m not able to install it. As you can tell, I’m a newbie and appreciate any help.

Cheers!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @fredj ,

Try this command:

tar -xvf phantomjs-2.1.1-linux-x86_64.tar.bz2

Maybe you executed the wrong command.Here is also one step you need to do to create soft links:

#move the files to a place you like

sudo mv phantomjs-2.1.1-linux-x86_64 /usr/local/src/phantomjs

#create soft links

sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs

This way you can use the phantomjs command directly in the shell.
Then we check:

phantomjs

If you can see version number,this program is working.

Regards,
Shiroka

  • Hi @Shiroka

    Thank you for the response. I tried your command and this is the screenshot of what I got:

    Example link

    Should I move the file to the location you’d suggested first and then install?

    Thanks again for all help.

    Best,
    Fred

    • Sure,you can have a try.Or you can download a new version like

      wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 
      

      (This is a old version).

      Or you can try enter one folder first,then run wget and tar commands.

Submit an Answer