Skip to content

Instantly share code, notes, and snippets.

@DominikStyp
Last active November 25, 2023 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominikStyp/7de2527601ba10b38103e3d1ffd50923 to your computer and use it in GitHub Desktop.
Save DominikStyp/7de2527601ba10b38103e3d1ffd50923 to your computer and use it in GitHub Desktop.
Laravel Sail + Docker: restart web container with enabled Xdebug
#!/bin/bash
CONTAINER_NAME="web"
echo "Stopping the web container..."
./vendor/bin/sail stop $CONTAINER_NAME
echo "Disabling Xdebug and setting mode to debug,develop..."
./vendor/bin/sail exec $CONTAINER_NAME bash -c "echo 'xdebug.mode=off' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
echo "Restarting PHP service in the container..."
./vendor/bin/sail exec $CONTAINER_NAME service php8.2-fpm restart
#!/bin/bash
CONTAINER_NAME="web"
echo "Stopping the web container..."
./vendor/bin/sail stop $CONTAINER_NAME
echo "Enabling Xdebug and setting mode to debug,develop..."
./vendor/bin/sail exec $CONTAINER_NAME bash -c "echo 'xdebug.mode=debug,develop' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
echo "Restarting PHP service in the container..."
./vendor/bin/sail exec $CONTAINER_NAME service php8.2-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment