Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Build with Docusaurus
run: npm run build

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
folder: build
branch: gh-pages
clean-exclude: pr-preview
force: false
43 changes: 43 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy PR previews

concurrency: preview-${{ github.ref }}

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
if: github.event.action != 'closed'

- name: Install dependencies
run: npm ci
if: github.event.action != 'closed'

- name: Build with Docusaurus
run: npm run build
env:
BASE_URL: "/${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.pull_request.number }}/"
if: github.event.action != 'closed'

- name: Deploy PR Preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: build
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Design mockups (reference only, not part of the site)
/design

# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# website
The code behind the public php-debugger.dev website

The code behind the public php-debugger.dev website, built with [Docusaurus](https://docusaurus.io/).

## Development

```bash
npm install
npm run start # dev server with hot reload at http://localhost:3000
```

## Production build

```bash
npm run build # outputs to build/, fails on broken internal links
npm run serve # serve the production build locally (search works here)
```

## Deployment

- **Pull requests**: `.github/workflows/preview.yml` builds the site with the PR-specific base path and deploys a preview to the `gh-pages` branch under `pr-preview/pr-<N>/`.
- **Push to `main`**: `.github/workflows/deploy.yml` builds and deploys the site to the `gh-pages` branch, which GitHub Pages serves.

## Content

Documentation pages are Markdown files in `docs/`, organised by sidebar category (see `sidebars.js`). The home page is `docs/index.mdx`, composed from the React components in `src/components/`. Design mockups live in `design/` for reference.
9 changes: 9 additions & 0 deletions docs/advanced/performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Performance
---

How PHP Debugger achieves near-zero overhead when not connected, and how to measure its impact.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/advanced/remote-debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Remote Debugging
---

Debug applications running in containers, VMs, or remote servers by connecting back to your local IDE.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/advanced/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Troubleshooting
---

Common problems and how to diagnose them: connection issues, missed breakpoints, and logging.

:::note
This page is a work in progress — full documentation is coming soon.
:::
32 changes: 32 additions & 0 deletions docs/getting-started/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Configuration
---

PHP Debugger is configured through `php.ini` directives. Because it is a fork of Xdebug, most settings will look familiar — with the `php_debugger.` prefix.

## Common settings

```ini
zend_extension=php_debugger

; debug is the only mode; profiling, coverage, and tracing were removed
php_debugger.mode=debug

; start a session only when triggered (recommended), or always
php_debugger.start_with_request=trigger

; where your IDE is listening
php_debugger.client_host=127.0.0.1
php_debugger.client_port=9003
```

## Directives

| Directive | Default | Description |
| --- | --- | --- |
| `php_debugger.mode` | `debug` | Operating mode. Set to `off` to disable the extension entirely. |
| `php_debugger.start_with_request` | `trigger` | `trigger` starts a session only when a trigger is present; `yes` starts on every request. |
| `php_debugger.client_host` | `127.0.0.1` | Host the debugger connects back to (your IDE). |
| `php_debugger.client_port` | `9003` | Port the debugger connects back to. |

See the [Configuration File](../reference/configuration-file.md) reference for the complete list of directives, and [Environment Variables](../reference/environment-variables.md) for runtime overrides.
34 changes: 34 additions & 0 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Installation
---

Installing PHP Debugger is straightforward and similar to installing other PHP extensions. The extension is available through PIE and can also be compiled from source. Once installed, you'll need to configure your php.ini file to enable the extension and set up your IDE to communicate with the debugger using the DBGp protocol.

## Configuration

Add the following to your `php.ini` file:

```ini
zend_extension=php_debugger
php_debugger.mode=debug
php_debugger.start_with_request=trigger
php_debugger.client_host=127.0.0.1
php_debugger.client_port=9003
```

## Usage Example

You can trigger breakpoints programmatically in your PHP code:

```php
<?php
function processData($data) {
// Process some data
$result = transform($data);

// Trigger breakpoint for debugging
php_debugger_break();

return $result;
}
```
23 changes: 23 additions & 0 deletions docs/getting-started/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Introduction
---

PHP Debugger is a modern debugging extension for PHP that focuses exclusively on step debugging functionality. Built as a fork of Xdebug, it removes profiling, coverage, and tracing features to achieve near-zero overhead when debugging is not active. This makes it ideal for development environments where you want debugging capabilities without impacting performance during regular development work.

## Key Features

Everything you need for a great debugging experience:

- **[Breakpoints](../user-guide/breakpoints.md)** — set breakpoints anywhere in your code with conditional support.
- **[Step Debugging](../user-guide/step-debugging.md)** — step over, into, and out of code with ease.
- **[Variable Inspection](../user-guide/inspect-variables.md)** — inspect variables, objects, arrays, and their properties.
- **[Watch Expressions](../user-guide/watch-expressions.md)** — watch expressions and get notified when they change.
- **[CLI & Remote](../advanced/remote-debugging.md)** — debug CLI scripts and remote applications.
- **[Logging](../user-guide/logging.md)** — powerful logging capabilities for debugging and tracing.

## What's Next?

Ready to get started? Install PHP Debugger and try the quick start guide:

- [Installation Guide](./installation.md)
- [Quick Start](./quick-start.md)
37 changes: 37 additions & 0 deletions docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Quick Start
---

Get up and running with PHP Debugger in a few minutes. This guide assumes you have already [installed](./installation.md) the extension.

## 1. Enable the debugger

Add the following to your `php.ini` file:

```ini
zend_extension=php_debugger
php_debugger.mode=debug
php_debugger.start_with_request=trigger
```

## 2. Start listening in your IDE

Configure your IDE to listen for debug connections on port `9003` (the default). See the [IDE Support](../integrations/ide-support.md) guide for instructions for PhpStorm, VS Code, and Neovim.

## 3. Set a breakpoint and run

Set a breakpoint in your editor, then trigger a debug session:

- **Web request**: add `XDEBUG_TRIGGER=1` as a cookie, GET, or POST parameter.
- **CLI script**: set the trigger in the environment:

```bash
XDEBUG_TRIGGER=1 php your-script.php
```

The debugger connects to your IDE, pauses at your breakpoint, and you can step through code, inspect variables, and evaluate expressions.

## Next steps

- Learn about [breakpoints](../user-guide/breakpoints.md) and [step debugging](../user-guide/step-debugging.md).
- Fine-tune behaviour in the [Configuration](./configuration.md) guide.
24 changes: 24 additions & 0 deletions docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
id: home
slug: /
title: PHP Debugger
description: Zero-overhead debugging for PHP — a lightweight, powerful debugger that doesn't slow you down.
displayed_sidebar: docsSidebar
hide_title: true
hide_table_of_contents: true
pagination_next: null
pagination_prev: null
---

import HomeHero from '@site/src/components/HomeHero';
import HomeFeatureStrip from '@site/src/components/HomeFeatureStrip';
import HomeCards from '@site/src/components/HomeCards';
import CtaBanner from '@site/src/components/CtaBanner';

<HomeHero />

<HomeFeatureStrip />

<HomeCards />

<CtaBanner />
9 changes: 9 additions & 0 deletions docs/integrations/ide-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: IDE Support
---

PHP Debugger works seamlessly with any IDE that supports the DBGp protocol, including PhpStorm, VS Code, and Neovim.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/integrations/neovim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Neovim
---

Debug PHP in Neovim using nvim-dap and the DBGp adapter.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/integrations/phpstorm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: PhpStorm
---

PhpStorm has first-class DBGp support: listen for connections and debug with zero extra plugins.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/integrations/vs-code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: VS Code
---

Debug PHP in Visual Studio Code using the PHP Debug extension — configuration and troubleshooting.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/reference/cli-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: CLI Options
---

Command-line options for controlling PHP Debugger when running scripts from the terminal.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/reference/configuration-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Configuration File
---

The complete reference of php.ini directives supported by PHP Debugger.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/reference/debug-protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Debug Protocol
---

PHP Debugger speaks the DBGp protocol, making it compatible with any IDE or tool that supports Xdebug.

:::note
This page is a work in progress — full documentation is coming soon.
:::
9 changes: 9 additions & 0 deletions docs/reference/environment-variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Environment Variables
---

Environment variables that trigger and configure debug sessions at runtime, overriding php.ini settings.

:::note
This page is a work in progress — full documentation is coming soon.
:::
Loading
Loading