Centos6.5安装Cutycapt

Cutycapt可以在后台对网页进行截屏,作者在后台对富文本页面截屏,生成长微博。
1.下载Cutycapt代码进行编译。目前Cutycapt只提供了window平台的代码,只能从sourcefore下载。
http://sourceforge.net/p/cutycapt/code/HEAD/tree/CutyCapt/
svn checkout http://svn.code.sf.net/p/cutycapt/code/ cutycapt-code
2、进入源码,在cutycapt-code文件内还有一个CutyCapt文件夹,才是真正的源码
cutycapt-code/CutyCapt
#cd cutycapt-code
#mv CutyCapt /usr/local/cutycapt
#cd /usr/local/cutycapt
#qmake
#make
如果提示找不到qmake
find -name qmake
./usr/lib/qt47/bin/qmake
找到qmake的位置后,在 /usr/local/cutycapt目录下执行
#/usr/lib/qt47/bin/qmake
#make
如果提示没有make
#yum install gcc gcc-c++
ll命令查看目录,生成了CutyCapt文件,这个文件就是可以执行的文件。
3、按网上的方法,下载下载x-server
 
#wget http://www.flexthinker.com/wp-content/uploads/2009/11/xvfb-run.sh.txt
#mv ./xvfb-run.sh.txt/usr/local/cutycapt/xvfb-run.sh
#chmodu+x /usr/local/CutyCapt/xvfb-run.sh
测试代码:
/usr/local/cutycapt/xvfb-run.sh --server-args="-screen 0, 1024x768x24"/usr/local/cutycapt/CutyCapt --url=http://www.php100.com--out=/tmp/163.jpg
如果出现两个问题,按照网上的处理办法
Q:错误提示:"mktemp: too few X's in template `Xauthority'."
A: 找到 AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority)
  修改为:AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXXXX)

Q:错误提示:CutyCapt: cannot connect to X server :99
A: 确认server-args参数是否正确,
 修改xvfb-run.sh脚本中SERVERNUM=99 改为SERVERNUM=0
测试成功。
 
但是用php的System()命令,不能执行,与Apache的不能执行sh有关。只要直接安装x-server就可以
yum -y install Xvfb
 
 
附录:安装qt
vi /etc/yum.repos.d/atrpms.repo
[atrpms]
name=CentOS $releasever – $basearch – ATrpms
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
      
[atrpms-testing]
name=CentOS $releasever – $basearch – ATrpms testing
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1
enabled=1
      
yum update
yum install qt47
yum install qt47-devel
yum install qt47-webkit
yum install qt47-webkit-devel
 
也许这里还会有报错提示
warning: qt44-x11-4.4.3-10_4.el5.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 66534c2b
error: Failed dependencies:
        libGLU.so.1()(64bit) is needed by qt44-x11-4.4.3-10_4.el5.x86_64
        libmng.so.1()(64bit) is needed by qt44-x11-4.4.3-10_4.el5.x86_64
解决:
yum -y installqt-devel*

转载于:https://www.cnblogs.com/birdskyws/p/3887822.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值