Cannot install phantomjs on server

I find it difficult to install phantomjs on my server. I have not found very good directions anywhere, and the best I have found gives me errors when I try to complete them. I am currently following these steps and getting these errors.

Successfully used putty to login as root and executed the following commands

Line 1: yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++ No errors Line 2: wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 No errors Line 3: mkdir -p /opt/phantomjs No errors Line 4: tar -xjvf ~/phantomjs-1.9.8-linux-x86_64.tar.bz2 --strip-components 1 /opt/phantomjs/ Error: opt/phantomjs: Not found in archive 

For this error (line 4) I ftp to my server and did not see any directory for opt / phantomjs. I created one, but I have the same error "Not found in archive".

After that, only the other lines of code from what I found should be:

 Line 5: ln -s /opt/phantomjs/bin/phantomjs /usr/bin/phantomjs Line 6: phantomjs /opt/phantomjs/examples/hello.js 

If anyone has an understanding, I would really appreciate it!

+5
source share
2 answers

Well, after many trial and error, it seems to work (for now). The problem was the syntax of line 4. This solved the problem, and lines 5 and 6 worked fine.

 UPDATED LINE 4: tar -xjvf ~/phantomjs-1.9.8-linux-x86_64.tar.bz2 --strip-components=1 -C /opt/phantomjs/ 

Hope this helps someone else having the same issue.

Does anyone know a good tutorial on using it for tall diagrams in php?

+16
source

I used this command to put binay in / usr / local / bin

 curl -Ls https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2 | tar jxvf - --strip-components=2 -C /usr/local/bin/ ./phantomjs-1.9.8-linux-x86_64/bin/phantomjs 
0
source

All Articles