Skip to content

Commit ceac9c1

Browse files
authored
Merge pull request #4 from millerp/feature/add-xdebug
add xdebug and enable with env var
2 parents 8e91494 + 446d0c0 commit ceac9c1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ RUN pecl install redis \
6262
# Install Composer
6363
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer
6464

65+
# Install XDebug
66+
RUN cd /tmp && wget http://xdebug.org/files/xdebug-2.5.4.tgz && tar -xvzf xdebug-2.5.4.tgz && cd xdebug-2.5.4 \
67+
&& phpize && ./configure && make && cp modules/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20160303 \
68+
&& rm -rf /tmp/xdebug-2.5.4.* /tmp/xdebug-2.5.4/
69+
6570
# Run composer install
6671
CMD /usr/bin/apache-run
6772

apache-run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/usr/bin/env bash
22

3+
if [[ $XDEBUG_ENABLED == true ]]; then
4+
echo "zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini
5+
echo "xdebug.var_display_max_depth=15" >> /usr/local/etc/php/conf.d/xdebug.ini
6+
fi
7+
38
usermod -u 1000 www-data \
49
&& cd /var/www/html && composer install && rm -rf var/cache/* var/logs/* \
510
&& chown -R www-data:www-data /var/www/html/var/cache && chmod 777 /var/www/html/var/cache \

0 commit comments

Comments
 (0)