Php uses CutyCapt to save Webpage screenshots

Source: Internet
Author: User
This article mainly introduces how php uses CutyCapt to save web pages, and analyzes in detail the downloading and installation of CutyCapt in combination with the instance form, and the related operation skills of using CutyCapt for saving in php, for more information about how to save web pages, see the example in this article. We will share this with you for your reference. The details are as follows:

QQ is the most commonly used Web page function, or asp.net. In fact, we can also directly use php for web pages, here we will introduce the process of using CutyCapt to implement web pages in php:

CutyCapt: http://sourceforge.net/projects/cutycapt/files/cutycapt/

If you do not need to install windows CutyCapt, simply save it to your computer. then write the following php code:

 

If you are a linux system, you need to simply configure CutyCapt and install the website software CutyCapt.

1. install Qt47 and add the download source of qt47. the code is as follows:

vi /etc/yum.repos.d/atrpms.repo[atrpms]name=CentOS $releasever – $basearch – ATrpmsbaseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stablegpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpmsgpgcheck=1enabled=1[atrpms-testing]name=CentOS $releasever – $basearch – ATrpms testingbaseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testinggpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpmsgpgcheck=1enabled=1yum updateyum installqt47yum installqt47-develyum installqt47-webkityum installqt47-webkit-devel

The following error may be reported:

Warning: qt44-x11-4.4.3-10_4.el5.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 66534c2berror: 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 // solution: // yum-y installqt-devel *

II. install CutyCapt with the following code:

cd /data0/softwaresvn co https://cutycapt.svn.sourceforge.net/svnroot/cutycaptmv cutycapt/CutyCapt /usr/local/cutycaptcd /usr/local/cutycaptqmakemake

The following Error may be reported: make: *** [CutyCapt] Error 1

Solution: yum update sqlite, execute make again, if the qmake-qt47 is not successful, execute make again.

3. download x-server with the following code:

wget http://www.flexthinker.com/wp-content/uploads/2009/11/xvfb-run.sh.txtmv ./xvfb-run.sh.txt/usr/local/cutycapt/xvfb-run.shchmodu+x /usr/local/CutyCapt/xvfb-run.sh

4. install a Chinese package

yum installfonts-chinese

5. install ImageMagick

yum installImageMagick

6. test the code as follows:

/usr/local/cutycapt/xvfb-run.sh --server-args="-screen 0, 1024x768x24"/usr/local/cutycapt/CutyCapt --url=https://www.php1.cn--out=/tmp/163.jpg

163.jpg is not loaded into flash.

7. download the 64-bit flash plug-in. the code is as follows:

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.sohttp://ishare.iask.sina.com.cn/f/13659493.htmlll /usr/lib64/mozilla/plugins/lrwxrwxrwx 1 root root 41 06-27 14:00 libflashplayer.so ->/usr/lib64/flash-plugin/libflashplayer.so

The test is loaded successfully.

I hope this article will help you with PHP programming.

For more articles about how to save web pages using CutyCapt in php, refer to the Chinese PHP website!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.