Skip to content

Commit 5a0438a

Browse files
author
Naiba
committed
add option xdebug remote host for mac
1 parent b8eda00 commit 5a0438a

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.env.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
TZ=Europe/Moscow
22
SHELL=/bin/zsh
3+
HOSTIP=127.0.0.1
34

45
SYMFONY_ENV=dev
56
MYSQL_ROOT_PASSWORD=root

conf/php7xdebug/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
8787

8888
COPY etc/php-fpm.conf /usr/local/etc/
8989
COPY etc/php.ini /usr/local/etc/php/
90+
91+
# Put host's IP to php.ini
92+
ARG HOSTIP=127.0.0.1
93+
ENV HOSTIP ${HOSTIP}
94+
RUN echo xdebug.remote_host=$HOSTIP>>/usr/local/etc/php/conf.d/xdebug.ini
95+
9096
RUN chmod ugo+rX -R /usr/local/etc/php
9197

9298
# SSH

conf/php7xdebug/etc/php.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ upload_max_filesize = 64M
1010
[xdebug]
1111
xdebug.remote_enable=1
1212
xdebug.cli_color=1
13-
xdebug.remote_host=127.0.0.1
14-
#xdebug.remote_host="docker.for.mac.localhost" #for mac
1513
xdebug.collect_params=0
1614
xdebug.collect_return=0
1715
xdebug.collect_vars=0
1816
xdebug.auto_trace=0
1917
xdebug.profiler_enable=0
20-
xdebug.idekey=PHPSTORM
18+
xdebug.idekey=PHPSTORM

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ services:
8181
php7xdebug:
8282
env_file: .env
8383
build:
84+
args:
85+
- TZ=${TZ}
86+
- HOSTIP=${HOSTIP}
8487
context: ./conf/php7xdebug
8588
image: maxlab/php7xdebug
8689
restart: always

0 commit comments

Comments
 (0)