CUTYCAPT Download Address: http://sourceforge.net/projects/cutycapt/files/cutycapt/
Windows CUTYCAPT does not need to be installed and can be saved directly to your computer.
Then you write the PHP code as follows
The code is as follows |
Copy Code |
<?php /* Web screenshot function, must be installed IE+CUTYCAPT URL: the page to be screenshot Out: Picture save path PATH:CUTYCAPT Path CMD:CUTYCAPT Execute command For example: http://your php path. php?url=http://www.111cn.net */ $url =$_get["url"]; $imgname =str_replace (' http://', ', $url); $imgname =str_replace (' https://', ', $imgname); $imgname =str_replace ('. ', '-', $imgname); $out = ' d:/webroot/test/'. $imgname. PNG '; $path = ' D:/webserver/cutycapt.exe '; $cmd = "$path--url= $url--out= $out"; Echo $cmd; System ($CMD); ?> |
If you are a Linux system, you need a simple configuration cutycapt
Install site screenshot software cutycapt
First, install Qt47
Add qt47 download source
code is as follows |
copy code |
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 installqt47 Yum installqt47-devel Yum installqt47-webkit Yum installqt47 -webkit-devel |
There may also be an error message
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
Resolve:
yum-y installqt-devel*
Two, install cutycapt
The code is as follows |
Copy Code |
Cd/data0/software SVN Co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt MV Cutycapt/cutycapt/usr/local/cutycapt Cd/usr/local/cutycapt Qmake Make
|
There may be an error here
Make : * * * [CUTYCAPT] Error 1
Solve:
Yum Update SQLite
Execute make again
If it is not successful qmake-qt47 execute make again
Third, download X-server
The code is as follows |
Copy Code |
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
|
Four, install Chinese pack
Yum Installfonts-chinese
Five, install ImageMagick
Yum Installimagemagick
Six, test:
The code is as follows |
Copy Code |
/usr/local/cutycapt/xvfb-run.sh--server-args= "-screen 0, 1024x768x24"/usr/local/cutycapt/cutycapt--url=http:// Www.111cn.net--out=/tmp/163.jpg
|
163.jpg does not load out flash
Seven, download 64-bit Flash plugin:
The code is as follows |
Copy Code |
Cd/data0/software #wget Http://119.188.72.26/1/ishare.down.sina.com.cn/14036482.so?ssig=YB70Xk7Ph9&Expires=1340899200&KID =sina,ishare&ip=1340777795,114.255.44.&fn=libflashplayer.so <a href= "http://ishare.iask.sina.com.cn/f/13659493.html" target= "_blank" >http://ishare.iask.sina.com.cn/f/ 13659493.html</a> ll/usr/lib64/mozilla/plugins/ lrwxrwxrwx 1 root 06-27 14:00 libflashplayer.so->/usr/lib64/flash-plugin/libflashplayer.so cp/data0/software/libflashplayer.so/usr/lib64/flash-plugin/
|
Test Load Succeeded