Merge branch 'xdebug' of git://github.com/that0n3guy/nginx-php-fpm
This commit is contained in:
@@ -58,6 +58,7 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
|
|||||||
&& addgroup -S nginx \
|
&& addgroup -S nginx \
|
||||||
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
|
&& adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \
|
||||||
&& apk add --no-cache --virtual .build-deps \
|
&& apk add --no-cache --virtual .build-deps \
|
||||||
|
autoconf \
|
||||||
gcc \
|
gcc \
|
||||||
libc-dev \
|
libc-dev \
|
||||||
make \
|
make \
|
||||||
@@ -149,6 +150,8 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
|
|||||||
openssl-dev \
|
openssl-dev \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
dialog \
|
dialog \
|
||||||
|
autoconf \
|
||||||
|
make \
|
||||||
gcc \
|
gcc \
|
||||||
musl-dev \
|
musl-dev \
|
||||||
linux-headers \
|
linux-headers \
|
||||||
@@ -168,6 +171,7 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
|
|||||||
--with-jpeg-dir=/usr/include/ && \
|
--with-jpeg-dir=/usr/include/ && \
|
||||||
#curl iconv session
|
#curl iconv session
|
||||||
docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \
|
docker-php-ext-install pdo_mysql pdo_sqlite mysqli mcrypt gd exif intl xsl json soap dom zip opcache && \
|
||||||
|
pecl install xdebug && \
|
||||||
docker-php-source delete && \
|
docker-php-source delete && \
|
||||||
mkdir -p /etc/nginx && \
|
mkdir -p /etc/nginx && \
|
||||||
mkdir -p /var/www/app && \
|
mkdir -p /var/www/app && \
|
||||||
@@ -181,7 +185,7 @@ RUN echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repo
|
|||||||
pip install -U pip && \
|
pip install -U pip && \
|
||||||
pip install -U certbot && \
|
pip install -U certbot && \
|
||||||
mkdir -p /etc/letsencrypt/webrootauth && \
|
mkdir -p /etc/letsencrypt/webrootauth && \
|
||||||
apk del gcc musl-dev linux-headers libffi-dev augeas-dev python-dev
|
apk del gcc musl-dev linux-headers libffi-dev augeas-dev python-dev make autoconf
|
||||||
# ln -s /usr/bin/php7 /usr/bin/php
|
# ln -s /usr/bin/php7 /usr/bin/php
|
||||||
|
|
||||||
ADD conf/supervisord.conf /etc/supervisord.conf
|
ADD conf/supervisord.conf /etc/supervisord.conf
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ For more detailed examples and explanations please refer to the documentation.
|
|||||||
- [Setup](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/lets_encrypt.md#setup)
|
- [Setup](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/lets_encrypt.md#setup)
|
||||||
- [Renewal](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/lets_encrypt.md#renewal)
|
- [Renewal](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/lets_encrypt.md#renewal)
|
||||||
- [PHP Modules](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/php_modules.md)
|
- [PHP Modules](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/php_modules.md)
|
||||||
|
- [Xdebug](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/xdebug.md)
|
||||||
- [Logging and Errors](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/logs.md)
|
- [Logging and Errors](https://github.com/ngineered/nginx-php-fpm/blob/master/docs/logs.md)
|
||||||
|
|
||||||
## Guides
|
## Guides
|
||||||
|
|||||||
6
docs/xdebug.md
Normal file
6
docs/xdebug.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
## Install PHP Modules
|
||||||
|
Xdebug comes pre-installed. To enable xdebug you need to add a couple environment variables:
|
||||||
|
|
||||||
|
- `ENABLE_XDEBUG=1` This will add the xdebug.ini to your php extensions
|
||||||
|
- `XDEBUG_CONFIG=remote_host=you.local.ip.here` Sets an xdebug remote host environment var. This is usually your actual local computers IP.
|
||||||
|
- `PHP_IDE_CONFIG=serverName=NameUsedInPhpStormServerConfig` This is an example of how to use this in PhpStorm. You configure a server in php storm with a name, set that in this var.
|
||||||
@@ -131,6 +131,38 @@ if [ ! -z "$PHP_UPLOAD_MAX_FILESIZE" ]; then
|
|||||||
sed -i "s/upload_max_filesize = 100M/upload_max_filesize= ${PHP_UPLOAD_MAX_FILESIZE}M/g" /usr/local/etc/php/conf.d/docker-vars.ini
|
sed -i "s/upload_max_filesize = 100M/upload_max_filesize= ${PHP_UPLOAD_MAX_FILESIZE}M/g" /usr/local/etc/php/conf.d/docker-vars.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Enable xdebug
|
||||||
|
XdebugFile='/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini'
|
||||||
|
if [[ "$ENABLE_XDEBUG" == "1" ]] ; then
|
||||||
|
if [ -f $XdebugFile ]; then
|
||||||
|
echo "Xdebug enabled"
|
||||||
|
else
|
||||||
|
echo "Enabling xdebug"
|
||||||
|
echo "If you get this error, you can safely ignore it: /usr/local/bin/docker-php-ext-enable: line 83: nm: not found"
|
||||||
|
# see https://github.com/docker-library/php/pull/420
|
||||||
|
docker-php-ext-enable xdebug
|
||||||
|
# see if file exists
|
||||||
|
if [ -f $XdebugFile ]; then
|
||||||
|
# See if file contains xdebug text.
|
||||||
|
if grep -q xdebug.remote_enable "$XdebugFile"; then
|
||||||
|
echo "Xdebug already enabled... skipping"
|
||||||
|
else
|
||||||
|
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > $XdebugFile # Note, single arrow to overwrite file.
|
||||||
|
echo "xdebug.remote_enable=1 " >> $XdebugFile
|
||||||
|
echo "xdebug.remote_log=/tmp/xdebug.log" >> $XdebugFile
|
||||||
|
echo "xdebug.remote_autostart=false " >> $XdebugFile # I use the xdebug chrome extension instead of using autostart
|
||||||
|
# NOTE: xdebug.remote_host is not needed here if you set an environment variable in docker-compose like so `- XDEBUG_CONFIG=remote_host=192.168.111.27`.
|
||||||
|
# you also need to set an env var `- PHP_IDE_CONFIG=serverName=docker`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [ -f $XdebugFile ]; then
|
||||||
|
echo "Disabling Xdebug"
|
||||||
|
rm $XdebugFile
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -z "$PUID" ]; then
|
if [ ! -z "$PUID" ]; then
|
||||||
if [ -z "$PGID" ]; then
|
if [ -z "$PGID" ]; then
|
||||||
PGID=${PUID}
|
PGID=${PUID}
|
||||||
|
|||||||
Reference in New Issue
Block a user