Merge branch 'bugfix/fix-xdebug-remote-prefix' into 'master'

Bugfix/fix xdebug remote prefix

See merge request ric_harvey/nginx-php-fpm!258
This commit is contained in:
Ric Harvey
2019-09-17 12:08:06 +00:00
2 changed files with 8 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ The following flags are a list of all the currently supported options that can b
| WEBROOT | Change the default webroot directory from `/var/www/html` to your own setting |
| ERRORS | Set to 1 to display PHP Errors in the browser |
| HIDE_NGINX_HEADERS | Disable by setting to 0, default behaviour is to hide nginx + php version in headers |
| PHP_CATCHALL | Enable a 404 catch all to `index.php` -- changes `=404` on `try_files` to `/index.php?$args` |
| PHP_MEM_LIMIT | Set higher PHP memory limit, default is 128 Mb |
| PHP_POST_MAX_SIZE | Set a larger post_max_size, default is 100 Mb |
| PHP_UPLOAD_MAX_FILESIZE | Set a larger upload_max_filesize, default is 100 Mb |

View File

@@ -24,6 +24,12 @@ else
webroot=/var/www/html
fi
# Enables 404 pages through php index
if [ ! -z "$PHP_CATCHALL" ]; then
sed -i 's#try_files $uri $uri/ =404;#try_files $uri $uri/ /index.php?$args;#g' /etc/nginx/sites-available/default.conf
fi
# Setup git variables
if [ ! -z "$GIT_EMAIL" ]; then
git config --global user.email "$GIT_EMAIL"
@@ -165,7 +171,7 @@ if [[ "$ENABLE_XDEBUG" == "1" ]] ; then
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 "remote_host=host.docker.internal" >> $XdebugFile
echo "xdebug.remote_host=host.docker.internal" >> $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`.