Skip to content

Commit defd1fd

Browse files
guiceRic Harvey
authored andcommitted
Bugfix/fix xdebug remote prefix
1 parent 454fcd7 commit defd1fd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/config_flags.md

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

scripts/start.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ else
2424
webroot=/var/www/html
2525
fi
2626

27+
# Enables 404 pages through php index
28+
if [ ! -z "$PHP_CATCHALL" ]; then
29+
sed -i 's#try_files $uri $uri/ =404;#try_files $uri $uri/ /index.php?$args;#g' /etc/nginx/sites-available/default.conf
30+
fi
31+
32+
2733
# Setup git variables
2834
if [ ! -z "$GIT_EMAIL" ]; then
2935
git config --global user.email "$GIT_EMAIL"
@@ -165,7 +171,7 @@ if [[ "$ENABLE_XDEBUG" == "1" ]] ; then
165171
else
166172
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > $XdebugFile # Note, single arrow to overwrite file.
167173
echo "xdebug.remote_enable=1 " >> $XdebugFile
168-
echo "remote_host=host.docker.internal" >> $XdebugFile
174+
echo "xdebug.remote_host=host.docker.internal" >> $XdebugFile
169175
echo "xdebug.remote_log=/tmp/xdebug.log" >> $XdebugFile
170176
echo "xdebug.remote_autostart=false " >> $XdebugFile # I use the xdebug chrome extension instead of using autostart
171177
# 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`.

0 commit comments

Comments
 (0)