What is PhantomJS
How to Install PhantomJS on Hosting?
There are several things you need to prepare in advance.
First , you must know how to access the server via SSH . When installing, everything is done via SSH via the console. To know how to access the server via SSH, please read How to Access SSH via Terminal or PuTTy . Or for those of you who don't know what SSH is, please read What is SSH Server .
Second , because the installation process uses a lot of Linux commands, make sure you are familiar with various Linux commands . For those who don't know, please read 10 Linux Commands You Need to Know .
After you have passed the preparation stage, please do the install method of PhantomJS below
How to Install PhantomJS on Hosting
As for how to install PhantomJS on Hosting, namely,
1. SSH access on Hosting
Now please access the server via SSH using a terminal or PuTTy. If you are using Windows, feel free to use PuTTy. If you are using Linux or Mac, feel free to use the Terminal. To find out how, please read How to Access Server via SSH . Please write the following command,
ssh username @ controlpanelURL â€“p 64000
Keep in mind that SSH can only be done at a minimum of Super Hosting Packages
2. Download PhantomJS
After entering the hosting server, please download PhantomJS with the following command. The PhantomJS download page is located at https://phantomjs.org/download.html . PhantomJS can be installed on various Linux, Windows or Mac platforms. Please copy the download link then download using the wget command like the following command,
The download file has a .tar.bz2 extension. For that, you have to extract the file twice.
First, please follow the following command,
bzip2 -dk phantomjs-2.1.1-linux-x86_64.tar.bz2
Second, please extract the .tar file from PhantomJS with the following command,
tar -xjvf phantomjs-2.1.1-linux-x86_64.tar
3. PhantomJS testing
You need to know, actually, to run PhantomJS, you only need to enter the folder that was extracted and then enter
phantomjs-2.1.1-linux-x86_64/bin/the phantomjs file. Now that's the phantomjs file you have to run! To run it please write
4. Added PATH PhantomJS
In order to run the PhantomJS file, you must first add the PATH PanthomJS. This functions so that you can directly call the PhantomJS file with the phantomjs prefix. For example phantomjs filecobaphantom.js. To add the PhantomJS PATH, please write down the location of the phantomjs file in the file
.bash_profile. You can use the nano or vim editor.
Please add the location of the phantomjs file on the line
export PATH=after the
sign.For example the phantomjs file is in / home / me / then please write
: /home/my/phantomjs-2.1.1-linux-x86_64/bin /: $ PATH
* Note : If you use the nano editor, after adding PATH, please save it by clicking ctrl + x then press "Y" and enter.
5. Running PhantomJS
To check whether PhantomJS is running, please write a simple PhantomJS script.
console.log ('Hello, world!');
You can write the script using any editor. For example nano, gedit, vim or whatever. If using nano, please write nano filecobaphantom.js then copy the script and paste it. Don't forget to save with ctrl + x then Y then enter.
To run PhantomJS, please write
If the file is executed successfully, then PhantomJS is successfully installed!
How to install PhantomJS on Hosting is very easy. Unlike other JS families such as React.js, Node.js or Express.js. To install phantom.js, you only need to download and then set the PATH only. For those of you who are curious about how to install other JS families, please read How to Install NodeJS on Hosting or How to Install ExpressJS . If you are a big fan of Laravel, please read How to Install Laravel and How to Upload Laravel Files on Hosting . If you have questions, please contact the Support Team via live chat or send a ticket .