PHPackages                             octoper/lighthouse-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. octoper/lighthouse-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

octoper/lighthouse-php
======================

Interface for the Google Lighthouse

0.0.4(5y ago)48601MITPHPPHP ^7.4CI failing

Since Jun 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/octoper/lighthouse-php)[ Packagist](https://packagist.org/packages/octoper/lighthouse-php)[ Docs](https://github.com/octoper/lighthouse-php)[ GitHub Sponsors](https://github.com/octoper)[ RSS](/packages/octoper-lighthouse-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

Lighthouse
==========

[](#lighthouse)

[![Tests](https://github.com/octoper/lighthouse-php/workflows/Tests/badge.svg)](https://github.com/octoper/lighthouse-php/actions?query=workflow%3ATests)[![StyleCI](https://camo.githubusercontent.com/1653d67369735eca74e84b81834ece417b7792b9e229521a455abf85424986b3/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3237313031363031372f736869656c643f7374796c653d737175617265)](https://github.styleci.io/repos/271016017)[![Packagist Version](https://camo.githubusercontent.com/c6b1b0138e24ee9458c0a3075a92be71acfa48f683ca43502038c627a004366c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f63746f7065722f6c69676874686f7573652d706870)](https://packagist.org/packages/octoper/lighthouse-php)[![Packagist Downloads](https://camo.githubusercontent.com/0e0efe8419dac87809c5e0811b1d1dcae8aa6c61d2a28a1faa65616315491a1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6f63746f7065722f6c69676874686f7573652d706870)](https://packagist.org/packages/octoper/lighthouse-php)[![License](https://camo.githubusercontent.com/71186643add5f1be0577ec3ce93d153c1f832bb0a5dc97cc65c0acbf2986951d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f63746f7065722f6c69676874686f7573652d706870)](LICENSE.md)

**This package is a fork of** [dzava/lighthouse-php](https://github.com/dzava/lighthouse-php)

This package provides a PHP interface for [Google Lighthouse](https://github.com/GoogleChrome/lighthouse).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require octoper/lighthouse-php
```

Usage
-----

[](#usage)

Here's an example that will perform the default Lighthouse audits and store the result in `report.json` (You can use the [Lighthouse Viewer](https://googlechrome.github.io/lighthouse/viewer/) to open the report):

```
use Octoper\Lighthouse\Lighthouse;

(new Lighthouse())
    ->setOutput('report.json')
    ->accessibility()
    ->bestPractices()
    ->performance()
    ->pwa()
    ->seo()
    ->audit('http://example.com');
```

### Output

[](#output)

The `setOutput` method accepts a second argument that can be used to specify the format (json,html). If the format argument is missing then the file extension will be used to determine the output format. If the file extension does not specify an accepted format, then json will be used.

You can output both the json and html reports by passing an array as the second argument. For the example the following code will create two reports `example.report.html` and `example.report.json`.

```
use Octoper\Lighthouse\Lighthouse;

(new Lighthouse())
    ->setOutput('example', ['html', 'json'])
    ->performance()
    ->audit('http://example.com');
```

### Using a custom config

[](#using-a-custom-config)

You can provide your own configuration file using the `withConfig` method.

```
use Octoper\Lighthouse\Lighthouse;

(new Lighthouse())
    ->withConfig('./my-config.js')
    ->audit('http://example.com');
```

### Customizing node and Lighthouse paths

[](#customizing-node-and-lighthouse-paths)

If you need to manually set these paths, you can do this by calling the `setNodeBinary` and `setLighthousePath` methods.

```
use Octoper\Lighthouse\Lighthouse;

(new Lighthouse())
    ->setNodeBinary('/usr/bin/node')
    ->setLighthousePath('./lighthouse.js')
    ->audit('http://example.com');
```

### Passing flags to Chrome

[](#passing-flags-to-chrome)

Use the `setChromeFlags` method to pass any flags to the Chrome instance.

```
use Octoper\Lighthouse\Lighthouse;

(new Lighthouse())
    // these are the default flags used
    ->setChromeFlags(['--headless', '--disable-gpu', '--no-sandbox'])
    ->audit('http://example.com');
```

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [dzava](https://github.com/dzava)
- [octoper](https://github.com/octoper)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

2154d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68fe70ec9a3d1aae74cdf605e12d121817b1d387ecca178e3a76b3993dee29d0?d=identicon)[octoper](/maintainers/octoper)

---

Top Contributors

[![octoper](https://avatars.githubusercontent.com/u/6823226?v=4)](https://github.com/octoper "octoper (37 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

google-lighthouselighthouselighthouse-phplighthouse

###  Code Quality

TestsPest

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/octoper-lighthouse-php/health.svg)

```
[![Health](https://phpackages.com/badges/octoper-lighthouse-php/health.svg)](https://phpackages.com/packages/octoper-lighthouse-php)
```

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shivas/versioning-bundle

Symfony application versioning, simple console command to manage version (with providers e.g. git tag) of your application using Semantic Versioning 2.0.0 recommendations

1121.2M1](/packages/shivas-versioning-bundle)[eclipxe/cfdiutils

PHP Common utilities for Mexican CFDI 3.2, 3.3 &amp; 4.0

141129.9k6](/packages/eclipxe-cfdiutils)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[dzava/lighthouse

Interface for the Google Lighthouse project

4010.4k](/packages/dzava-lighthouse)[vaimo/composer-changelogs

Provide information about package changes based on changelog files that are bundled with releases; provide tools for generating documentation files from changelog sources

11150.5k10](/packages/vaimo-composer-changelogs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
