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

Yes—PHP can take a website screenshot on shared hosting if the account can run a compatible Chrome or Chromium executable, has its required runtime dependencies, and allows PHP to launch it. A PHP library can control that local browser, or a PHP script can invoke Chrome’s headless command line. Shared hosting does not guarantee those permissions, so check the account before building around local capture.

What has to work on the hosting account

A screenshot library does not render a page by itself. It controls a Chrome or Chromium process that must be available to the PHP process. Chrome Headless runs without a visible interface; Chrome’s current unified headless mode uses the regular Chrome browser code path. The separate chrome-headless-shell binary is a different option beginning with Chrome 132. See Chrome’s Headless mode documentation.

  • A compatible Chrome or Chromium binary must be installed or installable, and PHP must be able to execute it.
  • The server must provide the browser’s runtime dependencies and writable temporary/profile locations.
  • Available memory, CPU, process limits, storage and execution time must be sufficient for the capture workload.
  • The provider’s policy must permit browser automation and the traffic sent to target websites.

These are account-specific checks, not properties guaranteed by the label “shared hosting.” PHP’s exec() function can run an external program when enabled, while PHP configuration can disable functions and set resource limits. Neither fact establishes what a particular host permits: see the PHP exec() manual and PHP core configuration directives.

Check feasibility before writing the integration

  1. Ask the host whether it permits Chrome or Chromium processes for your account and whether its acceptable-use policy allows your intended automation.
  2. Find out whether SSH is available and whether a browser is already installed. Confirm the exact executable path; do not assume it is named chrome or chromium.
  3. Check whether the relevant PHP runtime can launch external processes. The PHP CLI and web-server PHP (SAPI) may have different configuration, enabled functions and limits.
  4. Ask about shared libraries, writable temporary and browser-profile directories, memory, CPU, process count, storage, script timeout and concurrent processes.
  5. Confirm whether the job can run through CLI or cron. Test under that exact execution context; a successful shell test does not prove the web PHP worker has the same access.

If SSH access is available, an administrator or host can check the executable and PHP CLI configuration. A successful which or command -v lookup is only a starting point: the PHP worker still needs permission to execute Chrome and access its dependencies and temporary files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

Use the PHP library to control local Chrome

The chrome-php/chrome project provides a PHP interface for headless Chrome/Chromium. Its documentation describes requirements of PHP 7.4–8.5 and Chrome/Chromium 65 or newer as displayed when researched; check the requirements for the exact package release you install. The project documents selecting a browser executable path, including through CHROME_PATH.

Install the package with Composer in your application, then adapt the executable path and output directory to your host. This example follows the project’s documented API; verify it against the package version in your lock file.

<?php

require __DIR__ . '/vendor/autoload.php';

use HeadlessChromiumBrowserFactory;

$factory = new BrowserFactory('/path/to/chrome');
$browser = $factory->createBrowser();

try {
    $page = $browser->createPage();
    $page->navigate('https://example.com/')->waitForNavigation();
    $page->screenshot()->saveToFile('/path/outside-public-web-root/page.png');
} finally {
    $browser->close();
}

Replace /path/to/chrome with the executable path confirmed for your account, and choose a writable destination. Saving outside the public web root avoids exposing captures through a predictable public URL. Do not let a request parameter choose an arbitrary filesystem path or pass untrusted input into a shell command.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.

Capture options

The library documents PNG, JPEG and WebP output, clipping a region, and full-page capture. Use the exact option names supported by your installed release; the repository documentation includes examples. Full-page capture can be more demanding than a viewport shot because the browser has to render a taller page. For pages that populate content only as you scroll, verify whether the page’s lazy-loaded sections have actually appeared before saving the image.

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

Use Chrome’s command line for a simple capture

For a one-off capture, Chrome’s official command-line reference documents --headless, --screenshot and --window-size. This command writes screenshot.png to the current working directory:

chrome --headless --screenshot --window-size=412,892 https://example.com/

The same reference documents --timeout, which sets a bounded wait before capture even if loading continues. For example:

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.
chrome --headless --screenshot --window-size=412,892 --timeout=5000 https://example.com/

Here, 5000 is a five-second wait in milliseconds, not a guarantee that every page’s dynamic content will be ready. Chrome’s flag behavior and available options are documented in the Chrome Headless command-line reference.

Calling the CLI from PHP

If you use PHP’s exec(), keep the executable and arguments controlled by your application. Never concatenate an untrusted URL or user-provided value into a shell command. PHP’s manual warns about escaping shell arguments when input is involved; even escaped input does not remove the need to validate allowed destinations. Also check command return status and output, and make sure the PHP process can write the capture directory.

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

$chrome = '/path/to/chrome';
$url = 'https://example.com/';
$out = '/path/outside-public-web-root/screenshot.png';

$command = escapeshellarg($chrome)
    . ' --headless --screenshot'
    . ' --window-size=412,892'
    . ' --timeout=5000 '
    . escapeshellarg($url)
    . ' 2>&1';

$output = [];
$status = 0;
exec($command, $output, $status);

if ($status !== 0 || !is_file($out)) {
    throw new RuntimeException('Chrome screenshot failed: ' . implode("n", $output));
}

This simplified sample demonstrates safe shell-argument quoting, but it does not specify Chrome’s output filename or working directory. Chrome writes its default screenshot.png in the current working directory, so production code must set a controlled working directory and handle the generated file deliberately. Prefer the PHP library when you need more explicit browser lifecycle and capture control. PHP documents exec() at php.net.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

Choose local Chrome or remote rendering

Consideration Local Chrome controlled by PHP Remote screenshot API
Host compatibility Requires a runnable browser, dependencies and permission to launch it. Does not require Chrome on the shared host, but does require network access to the provider.
Control A PHP library exposes browser navigation and capture behavior; the CLI suits simpler flag-based captures. Options and behavior are provider-specific.
Operations Your account must support process limits, temporary files, browser updates, logging and retries. Check the provider’s timeouts, quotas, reliability terms and handling of failed captures.
Privacy and security Rendering happens on your host, but target URLs, credentials, cookies and saved images still need careful handling. Page URLs and any supplied credentials or cookies go to a third party; review its privacy and retention terms.
Cost and limits Check hosting resource and usage limits with the provider. Compare current price, quota, resolution, full-page support and throughput; figures vary by service and plan.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your shared host cannot run Chrome, ScreenshotNeo can render a URL remotely. Its one-call PHP example is:

<?php

import_placeholder

Use this runnable PHP code instead of the placeholder above:

<?php

import requests

r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

The example is Python, not PHP; ScreenshotNeo documents a GET API, but no PHP snippet was supplied here. A PHP application can make an HTTP GET request to https://api.screenshotneo.com/v1/shot with access_key and url parameters using its HTTP client. See the ScreenshotNeo API documentation for the request details. Its documented distinctions include removing cookie banners, popups and chat widgets before capture, and not billing bot checks/CAPTCHAs, blank pages, timeouts, failed loads or cache hits. An MCP server provides screenshot tools for AI agents. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.

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

Sign up for 1,000 free screenshots a month, with no card required.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.

Troubleshooting common failures

  • Chrome is not found: The executable is absent or the path is wrong. Ask the host for the supported binary path; configure that exact path in BrowserFactory or your controlled command.
  • Permission denied or process functions disabled: The account or PHP SAPI cannot launch external programs. Check the web PHP configuration separately from CLI and ask the provider whether execution can be enabled; do not assume a different PHP configuration is permitted.
  • Chrome starts locally but fails under web PHP: The worker may have a different PATH, user, configuration, filesystem access or resource limit. Test using the same PHP SAPI and execution context as the application.
  • Missing shared library or browser startup error: The browser’s runtime dependencies may not exist in the account environment. Shared hosting may not permit installing them; ask the provider rather than copying arbitrary system libraries.
  • Profile or temporary-directory errors: Chrome needs writable runtime storage. Confirm available writable locations and quotas with the host, and use isolated, controlled temporary directories for concurrent jobs.
  • Capture times out or is incomplete: The page may be slow, dependent on asynchronous content, or constrained by the host’s execution limits. A fixed timeout is only a wait bound; tune it to the job and check whether the target content is present before capture.
  • Output file is missing: The CLI saves its default screenshot in the current working directory. Set and verify a controlled working directory, check the exit status and browser output, and confirm the PHP user can write there.
  • Process killed or server becomes unstable: Browser launches can consume substantial resources, especially for concurrent or full-page jobs. Reduce concurrency, schedule captures carefully, and compare the host’s limits with a browser-capable server or remote service.

Plan for reliability, security and cost

Chrome is a full browser process, so account-level CPU, memory, process and time limits matter more as capture frequency, page complexity and concurrency increase. Start with a small number of captures, log the URL (after removing secrets), exit status, duration and failure reason, and close each browser after use. Use bounded timeouts and retry only failures that are plausibly transient; indiscriminate retries can multiply load or repeat traffic to a target.

Validate which destinations your application is allowed to capture, protect API credentials and cookies, and keep screenshots out of publicly accessible directories unless that is intentional. Do not put credentials in a URL likely to be logged. A remote service moves rendering off the host but introduces a third party that receives the requested page and any data you send; review its current security and retention terms. No universal cost or performance comparison follows from the fact that one route is local and another remote. Compare the actual host limits and service plan against your volume, page size, concurrency and privacy requirements.

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.

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