PHPackages                             jpcaparas/xdebug-demo - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. jpcaparas/xdebug-demo

ActiveProject[Debugging &amp; Profiling](/categories/debugging)

jpcaparas/xdebug-demo
=====================

A demo outlining the benefits of using Xdebug on your typical PHP development workflow.

18PHP

Since Jun 8Pushed 9y ago2 watchersCompare

[ Source](https://github.com/jpcaparas/xdebug-demo)[ Packagist](https://packagist.org/packages/jpcaparas/xdebug-demo)[ RSS](/packages/jpcaparas-xdebug-demo/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Xdebug Demo
===========

[](#xdebug-demo)

[![xdebug-logo](https://camo.githubusercontent.com/b194c0e0fc9dd01e89dc9e45df9b53669915c9ce681af0a876e2bdae34e60bb7/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f656e2f352f35652f5864656275672d6c6f676f2e706e67)](https://camo.githubusercontent.com/b194c0e0fc9dd01e89dc9e45df9b53669915c9ce681af0a876e2bdae34e60bb7/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f656e2f352f35652f5864656275672d6c6f676f2e706e67)

A demo outlining the benefits of using Xdebug on your typical PHP development workflow.

Requirements
============

[](#requirements)

1. PHP v5.6++ w/ Xdebug installed.
2. An IDE that supports Xdebug. This demo uses [PhpStorm](https://www.jetbrains.com/phpstorm/).
3. Google Chrome w/ the [Xdebug helper](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en) extension installed.
4. Shell access.

Installation
============

[](#installation)

To get started with this project, run:

```
composer create-project \
--prefer-source \
--stability=dev \
jpcaparas/xdebug-demo \
[dir-name]

```

---

Once cloned, run tests to ensure everything is intact:

```
./vendor/bin/codecept run

```

---

Xdebug might already be installed on your machine; to find out, run:

```
php -v

```

... which should result in an output similar to this:

```
PHP 7.1.5 (cli) (built: May 13 2017 13:30:32) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Xdebug v2.5.1, Copyright (c) 2002-2017, by Derick Rethans

```

If you don't have the `with Xdebug...` line, you'll have to download, enable, and configure the Xdebug extension.

Atlassian has a good, [multi-platform guide on how to install Xdebug](https://confluence.jetbrains.com/display/PhpStorm/Xdebug+Installation+Guide).

Usage
=====

[](#usage)

Wiring everything up
--------------------

[](#wiring-everything-up)

Once you have Xdebug configured, mark breakpoints throughout your code base:

[![Mark breakpoints](https://camo.githubusercontent.com/52a4ab3d826abe2b5c00aefe97cc72cac525a0ae1e0bfec8c8aae8418c42ac24/687474703a2f2f692e696d6775722e636f6d2f5363757638794c6c2e6a7067)](https://camo.githubusercontent.com/52a4ab3d826abe2b5c00aefe97cc72cac525a0ae1e0bfec8c8aae8418c42ac24/687474703a2f2f692e696d6775722e636f6d2f5363757638794c6c2e6a7067)

Upon marking, ensure that your IDE has been set up to become a debug client.

[![Listen for incoming connections](https://camo.githubusercontent.com/0b93446815a611203efe177866b1e59933260c3d4fb1c942b58d1b99d36a29f9/687474703a2f2f692e696d6775722e636f6d2f4b353255667a366d2e706e67)](https://camo.githubusercontent.com/0b93446815a611203efe177866b1e59933260c3d4fb1c942b58d1b99d36a29f9/687474703a2f2f692e696d6775722e636f6d2f4b353255667a366d2e706e67)

... and allow the browser to connect to the client.

[![Chrome browser extension](https://camo.githubusercontent.com/d98146f6c12fcee9c15b1a11384d0d521e53f37a96837aeba99390207328f432/687474703a2f2f692e696d6775722e636f6d2f6a7774627132586d2e706e67)](https://camo.githubusercontent.com/d98146f6c12fcee9c15b1a11384d0d521e53f37a96837aeba99390207328f432/687474703a2f2f692e696d6775722e636f6d2f6a7774627132586d2e706e67)

Now spin up a built-in web server from the terminal and we'll start debugging:

```
php -S localhost:8000 -t public

```

Connecting to the debug client
------------------------------

[](#connecting-to-the-debug-client)

Open your browser on `http://localhost:8000`. You should see a form that asks for a GitHub username.

Assuming that you have added breakpoints to the `./src/Services/GitHubService.php` file, your should be able to breakpoint into the code upon sending the `POST` request.

If the connection was successful, you'll be taken to the `Debugger` pane on PhpStorm, where you'll see a lot of stuff going on:

[![](https://camo.githubusercontent.com/ecfe4eb6675bef107e3cc2e27458fa1e0e15ea4a627398effef8a44a88273e8e/687474703a2f2f692e696d6775722e636f6d2f414b4d443641686c2e6a7067)](https://camo.githubusercontent.com/ecfe4eb6675bef107e3cc2e27458fa1e0e15ea4a627398effef8a44a88273e8e/687474703a2f2f692e696d6775722e636f6d2f414b4d443641686c2e6a7067)

At this point, all you need to do is familiarise yourself with the various commands at your disposal (e.g. frames, variables, console, stepping).

More information about the various Debugger features can be seen [here](https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm).

Gotchas
=======

[](#gotchas)

> `composer` has become slower following Xdebug's installation. Is it possible to disable Xdebug on `composer` usage?

Yes, append this nifty script on your `~/.bash_aliases` file (or its equivalent):

```
alias composer="php -n -d memory_limit=-1 $(which composer)"

```

The `-n` flag effectively disables PHP from reading the `php.ini` file (where Xdebug is defined).

Resources
=========

[](#resources)

*Coming soon...*

Attributions
============

[](#attributions)

This demo is part of [Pixel Fusion](https://pixelfusion.co.nz) *Engineering Talks* held every Friday, wherein we showcase tools and methodologies that empower developer productivity.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2406808?v=4)[JP Caparas](/maintainers/jpcaparas)[@jpcaparas](https://github.com/jpcaparas)

---

Top Contributors

[![jpcaparas](https://avatars.githubusercontent.com/u/2406808?v=4)](https://github.com/jpcaparas "jpcaparas (21 commits)")

---

Tags

debuggingphpphpstormxdebug

### Embed Badge

![Health badge](/badges/jpcaparas-xdebug-demo/health.svg)

```
[![Health](https://phpackages.com/badges/jpcaparas-xdebug-demo/health.svg)](https://phpackages.com/packages/jpcaparas-xdebug-demo)
```

###  Alternatives

[fjogeleit/prometheus-messenger-middleware

Prometheus Middleware for the Symfony Messenger Component

2255.2k](/packages/fjogeleit-prometheus-messenger-middleware)[spatie/craft-ray

Easily debug CraftCMS projects

1638.4k](/packages/spatie-craft-ray)

PHPackages © 2026

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