Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How to Install PhantomJS on CentOS & Fedora

    How to Install PhantomJS on CentOS & Fedora

    By RahulAugust 3, 20192 Mins Read

    PhantomJS is a headless WebKit scriptable with a JavaScript API. This is helpful for testing webpages on the command line. This tutorial will help to install FantomJS on CentOS, RHEL, and Fedora systems. Essentially there is no installation required. You just need to download the static build of PhantomJS and configure on your system.

    Advertisement

    Step 1 – Prerequsities

    First, of all, you need to install the required packages needed by PhantomJS to work correctly.

    RedHat 8 & Fedora Users

    sudo dnf install glibc fontconfig freetype freetype-devel fontconfig-devel wget bzip2
    

    CentOS 7/6 Users:

    sudo yum install glibc fontconfig freetype freetype-devel fontconfig-devel wget bzip2
    

    Step 2 – 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:

    pre>
    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>
    

    javascript PhantomJS
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to List Manually Installed Packages in Ubuntu & Debian

    10 Bash Tricks Every Developer Should Know

    How to Validate Email Address in JavaScript

    View 1 Comment

    1 Comment

    1. shmakovpn on October 1, 2019 1:08 am

      In centos 6 I was need to append ‘/usr/local/bin’ to $PATH.
      PATH=”$PATH:/usr/local/bin”

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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