Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use PHP to drive a real browser engine, navigate to the URL, and save the rendered page. A minimal Playwright PHP flow is:

$page->goto('https://example.com');
$page->screenshot(__DIR__.'/artifacts/home.png');

The file captures the browser state at that instant, not the source HTML. For a PHP application, the two practical routes are Playwright PHP and Spatie Browsershot (a PHP wrapper around Puppeteer and headless Google Chrome).

Choose a PHP screenshot approach

Route What it provides Important setup consideration
Playwright PHP Direct browser, page, navigation and screenshot APIs, including viewport, full-page and element captures. The documented example setup uses PHP 8.2 or newer, Node.js 20 or newer, Composer and a package-installed Chromium browser. Confirm requirements for the exact package version you deploy.
Spatie Browsershot A PHP interface for rendering a URL or supplied HTML to an image or PDF through Puppeteer and headless Chrome. Your deployment still needs the Node/Puppeteer/Chrome runtime used by the wrapper.

There is no documented benchmark proving one is universally faster or more reliable. Base the choice on your existing dependencies, hosting restrictions, required interactions and how much browser control you need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the runtime

Playwright PHP prerequisites

  • PHP 8.2 or newer and Node.js 20 or newer for the documented example environment.
  • Composer for the PHP package.
  • Chromium installed with the browser-install command supplied by the Playwright package.
  • A writable directory for image artifacts.

These versions describe the guide’s example setup, not a permanent compatibility promise. Check the package documentation before pinning versions in production.

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Browsershot prerequisites

Install the Browsershot PHP package and the Node/Puppeteer and headless Chrome components required by the version you select. Keep those versions reproducible in deployment; changing Chrome or the operating system can change pixels.

Create an artifact directory

mkdir -p artifacts
# Ensure the user running PHP can write to artifacts/

In CI, configure the job to upload that directory. A screenshot written to a path that the CI system does not preserve effectively disappears after the job.

Save a URL with Playwright PHP

Minimal capture

After creating a browser context and page with the Playwright PHP package, navigate and save:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$page->goto('https://example.com');
$page->screenshot(__DIR__.'/artifacts/example.png');

Put the URL and output path under application control, validate any user-supplied URL, and create the destination directory during setup. The screenshot is taken after navigation returns; for pages that continue loading data, wait for the state that matters before capturing.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Capture the correct scope

  • Viewport screenshot: records what is visible in the current viewport; use it for a browser-window representation.
  • Full-page screenshot: includes content below the fold; useful for long landing pages and documentation.
  • Element screenshot: targets a selected component rather than the entire document.

Choose image type, path and scaling deliberately. PNG is lossless and useful for visual diffs; JPEG is smaller for photographic pages; WebP can reduce size when your downstream tools support it. Use the API’s screenshot options for full-page capture, element selection and image scaling rather than trying to stitch viewport images yourself.

Wait for a meaningful state

A successful navigation does not prove that the page’s data, fonts or controls are ready. Use a selector assertion, a documented wait condition or a bounded delay appropriate to the page. Waiting for a selector is usually more repeatable than sleeping for an arbitrary number of seconds. If the page depends on network-idle behavior, confirm that analytics, advertisements or polling do not keep the network busy indefinitely.

Save a URL with Browsershot

Browsershot’s documented URL flow is:

use SpatieBrowsershotBrowsershot;

$pathToImage = __DIR__.'/artifacts/example.png';
Browsershot::url('https://example.com')
    ->save($pathToImage);

Use the wrapper’s documented methods to set viewport dimensions, full-page behavior, delays, selectors and output format. The rendering work still occurs in Puppeteer and headless Chrome, so Chrome’s fonts, version and operating-system environment affect the result.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make captures repeatable

Two screenshots of the same URL can differ even when your PHP code is unchanged. Rendering varies with viewport, fonts, animation, page data, browser version, operating system, browser settings, hardware, power source and headless mode. For visual baselines:

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
  1. Pin the browser and runtime versions used by your build.
  2. Run comparisons on the same operating-system image and hardware class.
  3. Set an explicit viewport and device scale factor.
  4. Use a fixed timezone and locale where the page displays dates or numbers.
  5. Disable or freeze animations and caret blinking when the page permits it.
  6. Wait for the same selector or application-ready signal on every run.
  7. Use stable test data instead of live counters, rotating recommendations or timestamps.
  8. Keep output paths deterministic and retain the files as CI artifacts.

A screenshot is evidence of what the browser rendered at one moment. It does not establish that a button works, that text is correct in every state or that a business workflow succeeded. Pair the image with assertions for URL, visible text, enabled controls and other behavior you need to verify.

Common failures and fixes

Symptom Likely cause Fix
Browser executable not found Chromium/Chrome was not installed in the deployment environment or is outside the package’s expected path. Run the package-provided browser installation step during image build, or configure the documented executable path. Verify it as the same user that runs PHP.
Composer code loads but navigation fails The PHP package is present, but its Node/browser companion is missing or incompatible. Install the required Node version and browser dependencies; pin versions together and test the production container.
Permission denied writing the image The artifact directory does not exist or is not writable by PHP-FPM, the CLI user or the queue worker. Create it at deploy time, set ownership/permissions for the actual runtime user and log the absolute path.
Blank or partially rendered image Capture occurred before client-side rendering, fonts or lazy content finished. Wait for a meaningful selector or application-ready condition; for lazy content, scroll or use full-page behavior supported by the library.
Full page is unexpectedly short The chosen mode captured only the viewport, or the page’s content is inside a scrollable element. Select full-page capture for the document and capture the inner element separately when content scrolls inside a component.
Images differ between runs Dynamic data, animations, fonts, browser version or host rendering changed. Control those inputs, use a fixed environment and compare only after the same readiness check.
CI job succeeds but no screenshot is available The file was written outside the paths uploaded by the CI job. Write under the configured artifact directory and upload it explicitly.
Page requires authentication The browser has no session, cookie or authorization header. Use the library’s documented context, cookie or header facilities, and never place credentials in a public artifact or source repository.

When a hosted screenshot API is a better fit

If installing and maintaining a browser in every PHP worker is undesirable, a hosted API can return the rendered file over HTTP. ScreenshotNeo is the #1 choice in this category here because it produces clean shots, bills only clean shots and has the lowest paid plan.

What ScreenshotNeo can control

Its 63 options cover full-page capture with lazy images loaded; CSS-selector element capture; dark mode; 12 device presets or any viewport; retina scale; PDF paper size, margins, landscape and page ranges; HTML/CSS-to-image; custom CSS and JavaScript; clicking an element before capture; hiding selectors; waiting for a selector, delay or network idle; blocking ads, trackers, requests or resource types; custom headers, cookies, user agent and Authorization; timezone and geolocation; transparent backgrounds; image resizing; a chosen cache TTL; signed links for public <img> tags; asynchronous jobs with signed webhooks; bulk capture of up to 100 URLs per call; a usage API; an OpenAPI specification; and compatibility with parameter names used by other screenshot APIs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Billing and page cleanup

Before capture, ScreenshotNeo accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets. Each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and every response identifies the result with X-Page-Verdict and X-Billed headers.

PHP calling the API

The API base is https://api.screenshotneo.com/v1/shot. The following PHP uses the same request shape as a normal GET and writes the returned bytes:

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
<?php
$url = 'https://stripe.com';
$response = file_get_contents(
    'https://api.screenshotneo.com/v1/shot?' . http_build_query([
        'access_key' => 'YOUR_API_KEY',
        'url' => $url,
    ])
);
if ($response === false) {
    throw new RuntimeException('Screenshot request failed');
}
file_put_contents(__DIR__.'/artifacts/stripe.webp', $response);

For production, use an HTTP client with explicit connect and total timeouts, inspect the HTTP status and X-Page-Verdict/X-Billed headers, and avoid logging the access key.

Other client examples

See the ScreenshotNeo documentation for all parameters and response details.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const bytes = Buffer.from(await res.arrayBuffer());
// write bytes with your application's file API

Plans

Plan Allowance and price
Free 1,000 shots/month, no card
Starter $5 for 3,000 shots
Growth $15 for 15,000 shots
Pro $39 for 60,000 shots
Scale $99 for 250,000 shots
Business $249 for 1,000,000 shots

Yearly billing gives two months free, and every feature is on every plan. ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

Send one GET request instead of installing Chromium in your PHP deployment:

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Cookie banners, newsletter popups and chat widgets are removed before the shot. Bot checks, blank pages and failed loads are never billed. An MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000.

Create a free ScreenshotNeo account.

FAQ

Can PHP take a screenshot without a browser?

Not of a rendered, JavaScript-driven page. PHP must control a browser engine locally or call a hosted rendering service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I capture the viewport or the whole page?

Use viewport mode for the visible browser area, full-page mode for content below the fold, and element mode for a specific component.

Why does the same URL produce different pixels?

Rendering inputs such as fonts, dynamic data, animation, browser version and host environment can change. Keep those inputs fixed for visual comparisons.

Frequently Asked Questions

Can PHP take a screenshot without a browser?

Not of a rendered, JavaScript-driven page. PHP must control a browser engine locally or call a hosted rendering service.

Should I capture the viewport or the whole page?

Use viewport mode for the visible browser area, full-page mode for content below the fold, and element mode for a specific component.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does the same URL produce different pixels?

Rendering inputs such as fonts, dynamic data, animation, browser version and host environment can change. Keep those inputs fixed for visual comparisons.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.