Script for taking webthumb using html2image tool


#cd /opt


#tar xvzf html2image.i386.tar.gz

#cd html2image

#export LD_LIBRARY_PATH=./

Save the shell script without sh extenstion in /opt/websnap

file name


#cd /opt/html2image



./Xvfb :1 -screen 0 1024x768x24 -nolisten tcp -audit 4 -auth X1.cfg & export DISPLAY=:1

./html2image $1 /home/test/public_html/$2

echo “html 2 image Done!”

Save the php script script wherever u want

PHP script (web_snap.php)

exec(“export LD_LIBRARY_PATH=/opt/”); // if html2image folder in /opt folder

// here html_2_image is above shell script

exec(“/opt/websnap google.png”, $result, $returnValue);


Execute “web_snap.php” with cron job, the result image will saved to “/home/siteroot /public_html/html2image/” folder.

Leave a Reply

Your email address will not be published. Required fields are marked *