读好书,交益友
分类: LINUX
2014-04-18 11:14:11
1 安装 phantomjs
sudo apt-get update
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.9
./build.sh
windows下编译比较复杂
不要下载git的包
下载源码
修改src\qt\preconfig.cmd,改变 OpenSSL 目录,如何编译openssl,看我以前的帖子
set OPEN_SSL_DIR=c:\OpenSSL
set QT_CFG=%QT_CFG% -openssl-linked
set QT_CFG=%QT_CFG% -I %OPEN_SSL_DIR%\include
set QT_CFG=%QT_CFG% -L %OPEN_SSL_DIR%\out32
set QT_CFG=%QT_CFG% -l libeay32
set QT_CFG=%QT_CFG% -l ssleay32
set QT_CFG=%QT_CFG% OPENSSL_LIBS="-L%OPEN_SSL_DIR:\=\\%\\lib -lssleay32 -llibeay32 -luser32 -lgdi32"
cd src\qt
preconfig.cmd
cd ..\..
src\qt\bin\qmake -r
nmake
静态编译的文件在bin/phantomjs.exe
2安装 casperjs windows最好不用casperjs
cd /study/js
git clone git://github.com/n1k0/casperjs.git
ln -sf /study/js/casperjs/bin/casperjs /usr/local/bin/casperjs
casperjs --version