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.