# Share phpDocumentor Output — PHP API Docs Without a Web Server

Canonical: https://commareports.com/share-phpdoc
Published: 2026-08-31

> phpDocumentor writes a multi-page docs/ site with its own assets and search. Publish the folder to Comma for a URL where navigation and search resolve.

# Share phpDocumentor output

`phpdoc -d src -t docs/` builds a browsable API reference: a namespace tree, a
page per class, inherited members resolved, and a search box. Like most
generated documentation sites it assumes it will be served over HTTP — open
`index.html` from disk and the search index request fails silently.

## Generate

```bash
phpdoc -d src -t docs/
```

Or via the PHAR / Composer binary in CI:

```bash
./vendor/bin/phpdoc -d src -t docs/
```

## Publish the folder

Drag `docs/` (or a zip of it) into [the app](https://commareports.com/):

- `index.html` becomes the **report body**.
- Class and namespace pages, `css/`, `js/` and the search index upload as
  assets, with their relative references rewritten to the uploaded copies.
- Scripts run inside a sandboxed iframe (`allow-scripts`, no
  `allow-same-origin`), so navigation and search behave.

No web server, no `docs/` in git, one URL for the whole reference.

## From CI

```bash
./vendor/bin/phpdoc -d src -t docs/

curl -fsS -X PATCH "https://commareports.com/api/v1/reports/$REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html docs/index.html \
        --arg title "API docs — $CI_COMMIT_REF_NAME" \
        '{title: $title, html: $html}')"
```

PATCH one report id per package: a stable link, a revision per release. See
the [API docs](/docs/api) for uploading the rest of the folder as assets.

## What review adds

- **Anchored threads** on a class or method — undocumented throws, stale
  `@param` types, examples that no longer compile. See
  [commenting on HTML](/comment-on-html).
- **Access per report** — private for an internal package, public for an open
  source one. See the [sharing model](/docs/sharing).

## Limits

- **Entry HTML: 5 MB.** Assets: 25 MB per file, 250 MB and 500 files total.
  A framework-sized codebase can approach the file cap; publish per component
  if it does.
- **60 requests/minute per token.**

## Try it

Comma is free — unlimited reports, unlimited commenters, unlimited revision
history.

**[Publish generated docs →](https://commareports.com/)**

### Related

- [Share a PHPUnit report](/share-phpunit-report) · [Share JSDoc output](/share-jsdoc)
- [Share Doxygen docs](/share-doxygen-docs) · [Share YARD docs](/share-yard-docs)
- [Share OpenAPI docs](/share-openapi-docs) · [Publish from CI](/docs/ci)
