How to check phantomjs is installed or not?

6,945 views
Skip to first unread message

Akhil K A

unread,
Jan 8, 2013, 3:37:32 AM1/8/13
to phan...@googlegroups.com
How to check phantomjs is installed or not?

Mine is a linux server with centos. How can I check whether phantomJS is installed or not? And how should I install it. The website of phantomJS just shows the link from which it should be downloaded. I need a more detailed instructions on installing it.
Please help me

Ariya Hidayat

unread,
Jan 8, 2013, 11:29:22 AM1/8/13
to phan...@googlegroups.com
> How to check phantomjs is installed or not?

You can use the amazing command-line tool called `which`. Learn more
about it by reading the documentation or other means.

> I need a more detailed instructions on installing it.

Be descriptive. What have you tried and what failed and what
instructions do you need?



Regards,


--
Ariya Hidayat, http://ariya.ofilabs.com
http://twitter.com/ariyahidayat
http://gplus.to/ariyahidayat

Akhil K A

unread,
Jan 8, 2013, 11:40:56 PM1/8/13
to phan...@googlegroups.com
ON using tool which, I got the following result
# which phantomjs
/usr/local/bin/phantomjs


But when I tried the example Hello World on the link https://github.com/ariya/phantomjs/wiki/Quick-Start, I didn't get any output.

What should I do?

Regards,
Akhil



--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
Visit this group at http://groups.google.com/group/phantomjs?hl=en.





--
Regards,
Akhil

Ariya Hidayat

unread,
Jan 9, 2013, 3:17:14 AM1/9/13
to phan...@googlegroups.com
> # which phantomjs
> /usr/local/bin/phantomjs

Then it should be installed. If you run it this way, it should print
the version number (very important).

/usr/local/bin/phantomjs -v

> But when I tried the example Hello World on the link
> https://github.com/ariya/phantomjs/wiki/Quick-Start, I didn't get any
> output.
> What should I do?

You should find out what's wrong, perhaps start by checking the
version number. In fact, think about it, with only so much information
that you provided, it is extremely hard to guess what the problem is.

Akhil K A

unread,
Jan 9, 2013, 3:32:18 AM1/9/13
to phan...@googlegroups.com
See what I got 


[~]# /usr/local/bin/phantomjs

Usage: phantomjs [options] script.[js|coffee] [script argument [script argument ...]]

Options:

--cookies-file=/path/to/cookies.txt    Sets the file name to store the persistent cookies
--config=/path/to/config               Specifies path to a JSON-formatted config file
--disk-cache=[yes|no]                  Enables disk cache (at desktop services cache storage location, default is 'no')
--ignore-ssl-errors=[yes|no]           Ignores SSL errors (i.e. expired or self-signed certificate errors)
--load-images=[yes|no]                 Loads all inlined images (default is 'yes')
/usr/local/bin/phantomjs

Usage: phantomjs [options] script.[js|coffee] [script argument [script argument ...]]

Options:

--cookies-file=/path/to/cookies.txt    Sets the file name to store the persistent cookies
--config=/path/to/config               Specifies path to a JSON-formatted config file
--disk-cache=[yes|no]                  Enables disk cache (at desktop services cache storage location, default is 'no')
--ignore-ssl-errors=[yes|no]           Ignores SSL errors (i.e. expired or self-signed certificate errors)
--load-images=[yes|no]                 Loads all inlined images (default is 'yes')
--load-plugins=[yes|no]                Loads all plugins (i.e. 'Flash', 'Silverlight', ...) (default is 'no')
--local-to-remote-url-access=[yes|no]  Local content can access remote URL (default is 'no')
--max-disk-cache-size=size             Limits the size of disk cache (in KB)
--output-encoding                      Sets the encoding used for terminal output (default is 'utf8')
--proxy=address:port                   Sets the network proxy (e.g. "--proxy=192.168.1.42:8080")
--proxy-type=[http|socks5]             Sets the proxy type, either "http" (default) or "socks5"
--script-encoding                      Sets the encoding used for the starting script (default is 'utf8')
--version                              Prints out PhantomJS version



Also I didn't get any response on checking the version

root@lc [~]# /usr/local/bin/phantomjs -v/usr/local/bin/phantomjs -v
root@lc [~]# 


--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
Visit this group at http://groups.google.com/group/phantomjs?hl=en.





--
Regards,
Akhil

Ariya Hidayat

unread,
Jan 9, 2013, 3:40:44 AM1/9/13
to phan...@googlegroups.com
I assume your version is kind of quite old. Try:

/usr/local/bin/phantomjs --version

Akhil K A

unread,
Jan 9, 2013, 4:14:51 AM1/9/13
to phan...@googlegroups.com
That too gives no result.
I was trying to install version 1.4.1.

I don't know how to install the new versions. Can you please help me to install the newer version or make the installed version working

On Wed, Jan 9, 2013 at 2:10 PM, Ariya Hidayat <ariya....@gmail.com> wrote:
/usr/local/bin/phantomjs --version




--
Regards,
Akhil

Ariya Hidayat

unread,
Jan 9, 2013, 4:40:22 AM1/9/13
to phan...@googlegroups.com
> That too gives no result.
> I was trying to install version 1.4.1.

Hardly believable. According to
https://github.com/ariya/phantomjs/blob/1.4/src/config.cpp, version
1.4 should have '--version' command-line option. Are you sure your
system is not completely screwed up?

> I don't know how to install the new versions. Can you please help me to
> install the newer version or make the installed version working

What have you tried? (Important: never forget to explain this before
you ask any question. We don't have telepathic power).

All you need to do is to grab the download file and extract it. Of
course, make sure you pick the right 32-bit vs 64-bit.

If you are new to Linux, please do yourself a favor and spend some
quality time with a good learning material such as the free "The Linux
Command Line" book (http://linuxcommand.org/tlcl.php). Archive
handling is nicely covered in Chapter 19.

Unless you have PhantomJS -specific installation issue, I stop here.


Regards,

Akhil K A

unread,
Jan 9, 2013, 4:53:56 AM1/9/13
to phan...@googlegroups.com
I have downloaded and extracted the new version(1.8.1) in the server.
When I tried to link th path using the command
 ln -s /phantomjs-1.8.1-linux-x86_64/bin/phantomjs /usr/local/bin/
I got an error 

ln: creating symbolic link `/usr/local/bin/phantomjs': File exists


How to resolve this?


--
You received this message because you are subscribed to the Google Groups "phantomjs" group.
Visit this group at http://groups.google.com/group/phantomjs?hl=en.





--
Regards,
Akhil

Reply all
Reply to author
Forward
0 new messages