Skip to content

Instantly share code, notes, and snippets.

View Aldo-f's full-sized avatar
🐛
Search and destroy.

Aldo Aldo-f

🐛
Search and destroy.
  • Creamy Coding
  • Ghent Belgium
View GitHub Profile
@Aldo-f
Aldo-f / restart_apaches.sh
Created March 6, 2024 14:12
restart_apaches.sh
#!/bin/bash
# Switch Xdebug state for different PHP configurations
PHP_VERSIONS=($(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$'))
PHP_SAPI=("cli" "fpm") # Add more SAPIs if needed
APACHE_RESTART_COMMAND="sudo /etc/init.d/apache2 restart"
for version in "${PHP_VERSIONS[@]}"; do
for sapi in "${PHP_SAPI[@]}"; do
# Restart PHP-FPM service for the current version