Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Programming»JavaScript»How to Install PhantomJS on Ubuntu & Debian

    How to Install PhantomJS on Ubuntu & Debian

    RahulBy RahulJanuary 21, 20172 Mins ReadUpdated:June 7, 2021

    PhantomJS is a headless web browser for automating web page interactions. The PhantomJS development has been discontinued by their team till the next information. It’s good to switch to an alternative of Phantom.js.

    The Phantom is available as ready to use binary. You just need to download the Phantomjs binary file and place it on your system available under the PATH environment. So it will be accessible throughout the system. This tutorial will help to set up FantomJS on Ubuntu and Debian systems.

    Prerequisites

    First, you should install or update system packages to the latest versions. Also, install the required packages needed by PhantomJS to work correctly.

    Open a terminal and udpate Apt cache first:

    sudo apt-get update 
    

    Then install required packages:

    sudo apt-get install build-essential chrpath libssl-dev libxft-dev 
    sudo apt-get install libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev 
    

    Step 1 – Install FantomJS

    Now download the latest FantomJS from its official website. After downloading the archive file, just extract this to the desired system location. You don’t need to install this.

    wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 
    tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/share/ 
    

    Now simply create a soft link phantomjs binary file to systems bin dirctory as below:

    sudo ln -sf /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin 
    

    Step 3 – Verify FantomJS Version

    After completing installation, let’s verify the installed version of phantomjs.

    phantomjs --version 
    
    2.1.1
    

    You can also find the version details from PhantomJS prompt. To get PhantomJS prompt type “phantomjs” on shell prompt and you will get the prompt. Now type phantom.version to get version details.

    phantomjs
    
    phantomjs> phantom.version
    {
       "major": 2,
       "minor": 1,
       "patch": 1
    }
    phantomjs>
    
    install PhantomJS javascript js PhantomJS setup PhantomJS
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Disable Comments on Attachments in WordPress
    Next Article How To Install Go 1.16 on LinuxMint 20/19/18

    Related Posts

    JavaScript Program to Add Two Numbers

    2 Mins Read

    How to Install ReactJS on Ubuntu 20.04

    3 Mins Read

    Remove First Character from String in JavaScript

    1 Min Read

    10 JavaScript Console Methods

    Updated:November 14, 20203 Mins Read

    JavaScript Program to Remove Duplicate Array Elements

    Updated:July 20, 20211 Min Read

    How to Use JSON.parse() and JSON.stringify()

    2 Mins Read

    7 Comments

    1. Javier Botero on June 6, 2021 6:27 pm

      Another grateful person because of this short and straightforward installation article!

      Reply
    2. Dmitry on May 19, 2021 8:31 pm

      Great job!

      Reply
    3. drake7 on February 26, 2020 4:17 pm

      I have OpenSSL 1.1.1d on my Debian 13.1.0
      When I typed ‘phantomjs –version’ I got an error: Autoconfiguration failed
      The solution to open ‘/etc/ssl/openssl.cnf’ and comment out the line under ‘[default_conf]’ (it is at the end of the config file):
      ‘#ssl_conf = ssl_sect’

      Reply
    4. Sergio on August 14, 2019 5:55 pm

      It worked perfect!! Thank you!

      Reply
    5. Carlos on June 20, 2019 8:05 am

      Muchas gracias! Ha funcionado a la perfección.

      Reply
    6. whatever on September 18, 2018 6:21 am

      spelling of phantomjs itself is so WRONG here

      Reply
    7. buzzy3 on April 28, 2017 12:07 pm

      you saved my day! Thanks

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.