5c661a48054d97f7835edaf3f5bfff30a73d9b9c
Stopgap for the PHP RCE advisories GHSA-6wmf-4rv5-p3rp and GHSA-w8hw-w9fx-j79w (2026-10-21): disable session.upload_progress (and fatal_error_backtraces on PHP 8.5). Upload progress should stay off even after patched PHP is deployed. Bump the EOL Alpine base to 3.24 so php83 receives the 8.3.36 security release. Alpine 3.24 no longer ships /usr/bin/php for php83, so add the link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
http2pic
Introduction
http2pic is an Open Source website renderer. It uses the wkhtmltox to render websites with various options.
Live demo on https://http2pic.haschek.at/
Dependencies
- wkhtmltox
- curl extension for PHP
apt-get install php5-curl - Make sure the server has the "timeout" command
apt-get install coreutils
Install
- Download this repo and extract it somewhere on your webserver
With WKHTMLToImage
- Install wkhtmltox on your server
- Make /usr/sbin/wkhtmltoimage executable for the user that runs the webserver. For Apache it's the
www-datauser. Or use sudo
With PhantomJS
- Install PhantomJS. eg via
npm install -g phantomjs - Make /usr/bin/phantomjs executable for the user that runs the webserver. For Apache it's the
www-datauser. Or use sudo
Upgrade
Whenever you come to this page you can just download the repo again and overwrite the existing files. Should work out of the box
Usage
https://your-host/api?url=[WEBSITE_URL]&[OPTIONS]
Parameters
| Parameter | Default | Description |
|---|---|---|
url |
— | Target URL to screenshot (required) |
viewport |
1024x768 |
Viewport size as WIDTHxHEIGHT (max 3840x2160) |
js |
true |
Enable JavaScript (true/false) |
fullpage |
false |
Capture full page height instead of viewport only |
maxheight |
15000 |
Max pixel height for full-page captures (1–30000) |
key |
— | API key (if API_KEY env var is set) |
Examples
# Standard viewport screenshot
curl "https://your-host/api?url=https://example.com" -o screenshot.png
# Full-page screenshot (great for LLM analysis)
curl "https://your-host/api?url=https://example.com&fullpage=true" -o full.png
# Full-page with custom width and height cap
curl "https://your-host/api?url=https://example.com&fullpage=true&viewport=1280x768&maxheight=20000" -o full.png
# With API key
curl -H "X-API-Key: your-secret" "https://your-host/api?url=https://example.com&fullpage=true" -o full.png
Use as an <img> src:
<img src="https://your-host/api?url=https://example.com" title="screenshot" />
Example php script to proxy an image to the local server
<?php
$targeturl = 'http://www.xkcd.com';
$url = 'https://http2pic.haschek.at/api.php?url='.rawurlencode($targeturl);
$ch = curl_init($url);
$fp = fopen('xkcd.jpg', 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>
This is a HASCHEK SOLUTIONS project
Languages
JavaScript
47.1%
PHP
29.3%
CSS
10.1%
Less
8.9%
Dockerfile
3.1%
Other
1.5%
