# Debugging with XDebug and PhpStorm on MacOS X

> So you have phpstorm and you want to debug your app step by step using Xdebug? Install Xdebug for PHP Homebrew make things simple. You will also need homebrew-php to have PHP-related formula. When the installation \[…\]

Source: https://antistatique.net/en/blog/debugging-with-xdebug-and-phpstorm-on-macos-x

Category: Development

# Debugging with XDebug and PhpStorm on MacOS X

Author(s)

[

![Simon](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/assets/avatar.png)



](#)

[Simon](#)17 September 2013

So you have [phpstorm](http://www.jetbrains.com/phpstorm/) and you want to debug your app step by step using [Xdebug](http://xdebug.org/)?

## Install Xdebug for PHP

[Homebrew](http://brew.sh/) make things simple. You will also need [homebrew-php](https://github.com/josegonzalez/homebrew-php) to have PHP-related formula.

```
brew install php54-xdebug
```

When the installation is done, brew give you some info:

```
To finish installing xdebug for PHP 5.4:
  * /usr/local/etc/php/5.4/conf.d/ext-xdebug.ini was created,
    do not forget to remove it upon extension removal.
  * Restart your webserver.
  * Write a PHP page that calls "phpinfo();"
  * Load it in a browser and look for the info on the xdebug module.
  * If you see it, you have been successful!
```

If you miss it and clear your terminal, you can get those info back with the following command.

```
brew info php54-xdebug
```

I'm using php-fpm so I just retart php-fpm.

To check xdebug was installed I used the php-cli, you can also use phpinfo(). Both should contain the xdebug configuration.

```
php -i | grep xdebug
```

## Configure XDebug and PHPStorm

I had to change the default port of xdebug because 9000 is taken by php-fpm on my machine.

So configure `/usr/local/etc/php/5.4/conf.d/ext-xdebug.ini` like that:

```
[xdebug]
zend_extension="/usr/local/Cellar/php54-xdebug/2.2.3/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port=10000
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.idekey=
```

And also change the port on phpstorm : [](http://antistatique.net/blog/wp-content/uploads/2013/09/phpstorm-xdebug-config.png)

## Launch a debug session

On phpstorm from the menu: _Run -> Start listen PHP debug connections_.

![Screenshot showing the Xdebug parameters to setup : Debug port = 10000](https://images.statique.ch/t/w_750,f_jpeg,q_70/wp/app/uploads/2020/12/phpstorm-xdebug-config.png)

With Firefox and https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/ you can quickly enable xdebug. On the addon's preferences set the IDE key to "PHPSTORM" (or the one you set in the phpstorm's preferences if you changed it). You then just have to refresh the page, phpstorm should then automatically start a debug session.

## More articles

Author(s)

[

![Anthony](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2024/11/anthony-1-300x300.png)



](/en/agence/anthony-salamone)

[Anthony](/en/agence/anthony-salamone)28 September 2026

### [Smashing Conference Freiburg 2026](/en/blog/smashing-conference-freiburg-2026)

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

Back in Freiburg for Smashing Conference 2026: AI and design systems, deeply technical CSS and HTML, and more human talks about teams and mindset. Here's what we took away.

[

![Smashing Conference Freiburg 2026 poster](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/assets/blog/smashing-2026.png)



](/en/blog/smashing-conference-freiburg-2026)

Author(s)

[

![Akira](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2025/03/akira-small-300x300.jpg)



](/en/agence/akira-kamata)

[Akira](/en/agence/akira-kamata)22 July 2026

### [Making of : “La nuit des Losers”](/en/blog/making-of-la-nuit-des-losers)

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

lanuitdeslosers.ch, built fast: paper wireframes, a bold hand-drawn identity, then Claude Code to prototype and ship. A mouse-tracking hero animation, a bowling game made of sponsor logos, and a few bugs we’re keeping.

[

![Making of : “La nuit des Losers”](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/05/La-nuit-des-Losers-Teaser-1-768x576.png)



](/en/blog/making-of-la-nuit-des-losers)

Author(s)

[

![Pierre](https://images.statique.ch/t/w_750,h_750,c_fill,f_jpeg,q_70/wp/app/uploads/2020/12/Pierre-300x300.jpg)



](/en/agence/pierre)

[Pierre](/en/agence/pierre)7 July 2026

### [Dark mode: necessity or trend](/en/blog/dark-mode-necessity-or-trend)

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

Nous faisons le tri entre idées reçues, réalités techniques et bonnes pratiques de design.

[

![Dark mode: necessity or trend](https://images.statique.ch/t/w_750,h_500,c_fill,f_jpeg,q_70/wp/app/uploads/2026/07/1-768x384.png)



](/en/blog/dark-mode-necessity-or-trend)
