# IP address for xdebug

**URL:** <https://forums.docker.com/t/ip-address-for-xdebug/10460>\
**Category:** Docker Desktop\
**Tags:** macos\
**Created:** [April 29, 2016, 2:25am UTC](https://forums.docker.com/t/ip-address-for-xdebug/10460 "2016-04-29T02:25:53Z")\
**Posts on this page:** 1\
**Showing post:** 31

<div class="post-metadata">

**Author:** ![jamescowie](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/jamescowie/32/14778_2.png) [@jamescowie](https://forums.docker.com/u/jamescowie)\
**Post date:** [January 1, 2017, 8:23pm UTC](https://forums.docker.com/t/ip-address-for-xdebug/10460/31 "2017-01-01T20:23:08Z")

</div>

After much pain I got this working with the following:  
Dockerfile

```auto
RUN apt-get update && apt-get upgrade -y && apt-get autoremove -y \
    && apt-get install -y git curl \
    && pecl install xdebug \
    && rm -rf /tmp/pear \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)\n"
       >> /usr/local/etc/php/conf.d/xdebug.ini

```

PHP.ini

```auto
xdebug.remote_host=10.254.254.254
xdebug.remote_autostart=1
xdebug.idekey = PHPSTORM
xdebug.default_enable = 0
xdebug.remote_enable = 1
xdebug.remote_connect_back = 0
xdebug.profiler_enable = 1

```

`sudo ifconfig en0 alias 10.254.254.254 255.255.255.0`

I wrote up and recorded my workflow here: [Debugging PHP apps](https://goo.gl/PS2Pyu)

Hope this helps someone.

---

_[View the full topic](https://forums.docker.com/t/ip-address-for-xdebug/10460)._
