Dev.to
7/17/2026
How to Take a Website Screenshot in PHP (Browsershot and the API Alternative)
Short summary
This tutorial covers two approaches for taking website screenshots in PHP: Browsershot (which shells out to Puppeteer and headless Chromium) and a hosted screenshot API. It includes working code for both, explains the server requirements for Browsershot, and covers common gotchas like capturing before page load completes. The API alternative removes the need to maintain a browser stack on your server.
- •Browsershot wraps Puppeteer/Chromium in a clean PHP API but requires Node.js and Chromium on the server
- •Common capture bugs can be avoided with waitUntilNetworkIdle, waitForFunction, and setDelay
- •A hosted screenshot API eliminates browser maintenance overhead for production use cases
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



