The method that PHP realizes to the website screenshot under Linux environment _php skill

Source: Internet
Author: User
Tags fpm install php zend wkhtmltopdf

This article describes the Linux environment in the implementation of PHP to the Web site screenshot method. Share to everyone for your reference, specific as follows:

The first step: Download wkhtmltopdf

Copy Code code as follows:
[Root@iz94aawoublz ~]# wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz

The second step: decompression

Copy Code code as follows:
[Root@iz94aawoublz ~]# xz-d Wkhtmltox-0.12.3_linux-generic-amd64.tar.xz

Step three: Continue to decompress

Copy Code code as follows:
[Root@iz94aawoublz ~]# tar xvf wkhtmltox-0.12.3_linux-generic-amd64.tar

Fourth Step: Select Directory

Copy Code code as follows:
[Root@iz94aawoublz ~]# CD Wkhtmltox
[Root@iz94aawoublz wkhtmltox]# ls
Bin include Lib Share

Fifth step: Select Lib Directory

Copy Code code as follows:
[Root@iz94aawoublz wkhtmltox]# CD lib/
[Root@iz94aawoublz lib]# ls
libwkhtmltox.so libwkhtmltox.so.0 libwkhtmltox.so.0.12 libwkhtmltox.so.0.12.3

Sixth step: Copy libwkhtmltox.so to Usr/local/lib

Copy Code code as follows:
[Root@iz94aawoublz lib]# CP Libwkhtmltox.so/usr/local/lib
[Root@iz94aawoublz lib]# CD ... /include/

Seventh Step

Copy Code code as follows:
[Root@iz94aawoublz include]# cp-r wkhtmltox//usr/local/include/

Eighth step: Install PHP Wkhtmltox

Copy Code code as follows:
[Root@iz94aawoublz include]# wget Https://github.com/mreiferson/php-wkhtmltox/archive/master.zip
[Root@iz94aawoublz include]# ls
Master.zip Wkhtmltox

Nineth Step: Decompression

Copy Code code as follows:
[Root@iz94aawoublz include]# Unzip Master.zip

Tenth step: Select Directory

Copy Code code as follows:
[Root@iz94aawoublz include]# CD php-wkhtmltox-master/

11th Step

Copy Code code as follows:
[Root@iz94aawoublz php-wkhtmltox-master]#/usr/local/php/bin/phpize
Configuring for:
PHP Api version:20131106
Zend Module Api no:20131226
Zend Extension Api no:220131226

12th Step: Install

Copy Code code as follows:
[Root@iz94aawoublz php-wkhtmltox-master]#./configure--with-php-config=/usr/local/php/bin/php-config
[Root@iz94aawoublz php-wkhtmltox-master]# make
[Root@iz94aawoublz php-wkhtmltox-master]# make install
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

13th step

Copy Code code as follows:
[Root@iz94aawoublz php-wkhtmltox-master]# echo "extension=phpwkhtmltox.so" >>/usr/local/php/etc/php.ini
[Root@iz94aawoublz php-wkhtmltox-master]# Service php-fpm restart
Gracefully shutting down php-fpm. Done

Did the test succeed?

Small test:

<?php
Wkhtmltox_convert (
  ' image ',
  array (
    ' out ' => ' test1.jpg ',
    ' => ') www.163.com/'
  )
);
? >

More interested in PHP related content readers can view the site topics: "PHP graphics and pictures Operating skills summary", "PHP operation Office Document Skills Summary (including word,excel,access,ppt)", "PHP date and Time usage summary", " Introduction to PHP object-oriented programming, "PHP string (String) Usage Summary", "Php+mysql Database Operations Introduction Tutorial" and "PHP Common database Operation tips Summary"

I hope this article will help you with the PHP program design.

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.