jonnyw/php-phantomjs
PHP PhantomJS is a headless browser wrapper for PHP that lets you load pages, run JavaScript, capture screenshots, and export to PDF. It provides a clean, extensible API over the PhantomJS binary, supports custom scripts, and works with any PHP project.
What it actually unlocked: jonnyw/php-phantomjs was a thin PHP wrapper around PhantomJS — a headless WebKit browser. As a PM, the decisions it informed were almost always "can we do X from our PHP/Laravel backend without a separate service?" The answer it enabled was usually yes for four recurring jobs:
curl/Guzzle returns an empty shell.Feature/roadmap framing today: this is a deprecation and migration decision, not an adoption decision. PhantomJS itself was discontinued in 2018, and this package was archived the same year with no releases since. Any roadmap item that depends on it should be treated as carrying unmitigated risk — no security patches, no PHP 8.x compatibility guarantee, no upstream bugfixes, and a shrinking pool of anyone who can maintain it. The score (~19.9) and negligible dependent count reflect that: this is a historical artifact, not a live dependency.
Build vs. buy: the relevant comparison has shifted. The decision is no longer "build a headless browser integration ourselves vs. use this wrapper" — it's "use a maintained wrapper around Chrome/Chromium (Browsershot + Puppeteer, or Playwright, or a hosted rendering API) vs. keep a dead runtime alive." Buying/adopting a maintained path is cheaper on every axis that matters: security, hiring, and PHP version support.
Where it still shows up in decisions: as a migration inventory item. If it's in your composer.json, the PM question is "which user-facing features actually depend on this, and what's the cost of switching each one?" Typical answer: PDF generation and screenshot endpoints move cleanly to headless Chrome; anything relying on PhantomJS-specific rendering quirks needs a visual diff pass.
Consider it only in these narrow cases:
Look elsewhere — decisively — when:
Replacement shortlist worth evaluating: Browsershot (Chrome via Puppeteer, Laravel-friendly, same "render HTML, get PDF or PNG" ergonomics), Playwright for anything interaction-heavy, and a hosted rendering API if you'd rather not run Chromium yourself.
To executives: "We have a dependency on a browser engine that was discontinued in 2018. It still works today, but nobody is fixing it — including for security issues — and it can't reliably render modern web pages, which means some of our generated documents may already look wrong. Nothing is on fire, but every month we keep it is unplanned risk and unplanned cost. I'd like to schedule a contained migration to a maintained browser runtime; the work is bounded, the features are enumerable, and the replacement is well-trodden."
To engineering: "Treat jonnyw/php-phantomjs as frozen. Wrap every call site behind a single interface so the runtime is swappable, then move the implementation to Chrome headless via Browsershot (or Playwright if we need real interaction). Expect two categories of change: straightforward API translation for screenshots and PDFs, and a visual-diff pass because Chrome renders differently from the old WebKit — assume some template CSS needs touching. Budget for updating any tests that assert on exact rendered output. Don't take new features on this package in the meantime."
The one-line summary: a well-designed wrapper around a dead engine — valuable as a map of what we need our renderer to do, not as something to build on.
How can I help you explore Laravel packages today?