Use PHP to send each URL to a headless browser, then save the resulting image under a predictable filename in your output directory. A practical starting point is chrome-php/chrome, which controls Chrome or Chromium directly. The same workflow applies on an Indian server; check that host’s PHP version, browser support, process limits, and directory permissions before deploying. The package requirements below are version-sensitive and should be confirmed in the maintainers’ current documentation.
Choose a PHP browser integration
PHP coordinates the work, but a browser runtime renders the site. Pick the integration based on how much browser control and deployment setup you want:
| Option | Best fit | Documented considerations |
|---|---|---|
| Chrome PHP | Direct control of Chrome or Chromium from PHP | Project documentation lists PHP 7.4–8.5 and Chrome/Chromium 65 or later, and covers navigation, viewport settings, and saving screenshots. Check the current documentation for installation and API details. |
| Playwright PHP | Playwright-style page, full-page, or element screenshots | The guide documents viewport, full-page, and element capture. Its examples list PHP 8.2+ and Node.js 20+; verify current prerequisites and host compatibility. |
| Spatie Browsershot | A higher-level wrapper around Puppeteer and Chrome | The README documents URL or HTML input and image output; it also notes that the older v2 CLI path is no longer maintained. |
For any option, compare the integration style with the deployment burden: the host may need a browser binary, PHP and possibly Node.js, permission to start processes, and a writable output path.
Prepare the URL list and destination directory
Put the sites to capture in a PHP array or load them from your application or a file. Create the destination directory before starting the batch, and check that PHP can write to it. Use a stable identifier, such as a record ID or a numbered index, in filenames. If deriving a name from a URL, sanitize it: URLs may contain characters unsuitable for filenames, and different URLs can collapse to the same slug.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Playwright PHP’s ScreenshotHelper reference documents filename-generation, directory-creation, cleanup, and directory-information helpers. These are useful ideas even if you choose another library.
Capture each site with Chrome PHP
The following illustrates the batch structure: open a browser, navigate to each URL, save a screenshot, and record each failure without treating it as a successful image. Install and initialize chrome-php/chrome using the current instructions in its project documentation; the precise API can change between releases, so match the calls to the version you install.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
<?php
require __DIR__ . '/vendor/autoload.php';
use HeadlessChromiumBrowserFactory;
$urls = [
'https://example.com',
'https://www.php.net',
];
$outputDir = __DIR__ . '/screenshots';
if (!is_dir($outputDir) && !mkdir($outputDir, 0755, true) && !is_dir($outputDir)) {
throw new RuntimeException("Could not create output directory: $outputDir");
}
if (!is_writable($outputDir)) {
throw new RuntimeException("Output directory is not writable: $outputDir");
}
$browserFactory = new BrowserFactory();
$browser = $browserFactory->createBrowser();
$failures = [];
try {
foreach ($urls as $index => $url) {
$page = null;
$filename = sprintf('%s/site-%03d.png', $outputDir, $index + 1);
try {
$page = $browser->createPage();
$page->navigate($url)->waitForNavigation();
$page->screenshot()->saveToFile($filename);
echo "Saved $url to $filenamen";
} catch (Throwable $e) {
$failures[] = ['url' => $url, 'error' => $e->getMessage()];
fwrite(STDERR, "Failed $url: {$e->getMessage()}n");
} finally {
if ($page !== null) {
$page->close();
}
}
}
} finally {
$browser->close();
}
if ($failures) {
file_put_contents(
$outputDir . '/failures.json',
json_encode($failures, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
);
exit(1);
}
This example uses numbered names to avoid collisions between URLs with similar hostnames or paths. Confirm the browser-creation, navigation-wait, page-close, and screenshot-save calls against the installed Chrome PHP version. For production, configure the browser’s executable and launch options as required by your environment and package version.
Choose what each screenshot should contain
- Viewport: captures the visible browser area. Set a consistent viewport when comparing sites or generating uniform directory thumbnails.
- Full page: includes content below the fold. It can produce tall images and may take longer on long pages; lazy-loaded content may need scrolling or another explicit loading strategy.
- Element: captures a particular component, such as a logo or listing card. Use a selector that exists after the page has rendered, and handle missing elements as a per-URL failure.
Chrome PHP documents viewport settings and screenshot saving; Playwright PHP documents viewport, full-page, and element capture. Consult the selected library’s current guide for the exact method and options.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Wait for the page state you actually need
A navigation event does not guarantee that every image, font, animation, or asynchronous widget has finished rendering. Choose a wait condition that matches the page and the output: a known selector, a suitable delay, or a network-idle condition where supported. For important captures, assert that the page or target element is present before writing the file. Playwright PHP’s guide recommends making capture state explicit.
For repeatable comparisons, keep the viewport, browser version, fonts, animations, page data, and execution environment consistent. Otherwise, image differences may reflect rendering conditions rather than a meaningful site change.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Run batches safely on an Indian host
The reviewed package documentation does not establish a distinct India-specific capture method. The same headless-browser workflow is a starting point, but compatibility depends on the particular server or hosting plan—not its country alone.
- Check the installed PHP and, for the chosen package, Node.js versions against its current requirements.
- Confirm Chrome or Chromium can be installed or is available, and that the PHP process is allowed to launch it.
- Verify process, memory, execution-time, and storage limits against the size and length of your batch.
- Test write permissions for the target directory as the same system user that runs PHP.
- Process URLs independently and keep a failure log. A timeout or blocked page should not silently appear as a successful capture.
Do not assume a package’s listed version support guarantees that a particular shared host or managed server permits browser processes. No India-specific benchmark, legal requirement, price, or provider recommendation is established by the cited project documentation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Or skip the browser setup
ScreenshotNeo is a screenshot API and MCP server for developers. One GET request can return an image or PDF, so your PHP job can request a capture without installing and operating a browser on the host. See the API documentation for parameters and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card required.
Troubleshoot common failures
| Symptom | Likely cause | What to check |
|---|---|---|
| Browser fails to start | Chrome/Chromium is missing, incompatible, or blocked by host permissions | Check the binary and package requirements, then verify that the server allows the PHP process to launch a browser. |
| Cannot save the image | The directory does not exist or PHP cannot write there | Create the directory and verify its owner, permissions, and writability under the account running the job. |
| Navigation times out | The site is slow, unreachable, or waiting behavior does not match the page | Record the affected URL, review the timeout and navigation wait condition, and retry that entry without discarding successful captures. |
| Screenshot is blank or incomplete | Capture began before the relevant content rendered, or the requested element was absent | Wait for a target selector or another meaningful page state and confirm it exists before capture. |
| Files overwrite one another | Filename generation produces duplicate names | Include a unique record ID or input index; do not rely only on a loosely sanitized URL slug. |
| Images differ between runs | Viewport, fonts, browser, animations, data, or environment changed | Control those rendering inputs before interpreting pixel differences. |
Protect and manage screenshot files
Images can contain private account data, tokens, or personal information visible on the captured page. Store only what the workflow needs, restrict access to the output directory, and define a retention or cleanup policy. Avoid logging sensitive query strings if URLs may contain credentials.
Frequently Asked Questions
Can PHP take a website screenshot without Chrome or another browser?
The documented PHP workflows here use a browser runtime to render the website; a PHP-only image function is not the documented approach.
Can I save screenshots as JPEG or WebP instead of PNG?
The specific output formats and encoding options depend on the library and version you install. Check its current screenshot documentation before choosing the filename extension.
Quick Recap
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.

