PHP debug.

This commit is contained in:
2026-03-18 22:36:34 +01:00
parent 3774e46924
commit 67b0fafeea
3 changed files with 48 additions and 1 deletions

View File

@@ -1,5 +1,29 @@
#!/bin/sh
# ============================================================
# PHP-Debug-Modus konfigurieren (per Umgebungsvariable)
# ============================================================
PHP_DISPLAY_ERRORS="${PHP_DISPLAY_ERRORS:-false}"
PHP_INI_DIR=$(find /etc/php -type d -name "conf.d" -path "*/apache2/*" | head -1)
if [ "$PHP_DISPLAY_ERRORS" = "true" ]; then
echo "==> PHP-Debug-Modus AKTIVIERT (PHP_DISPLAY_ERRORS=true)"
cat > "$PHP_INI_DIR/99-adminserv-debug.ini" <<EOF
display_errors = On
error_reporting = E_ALL
log_errors = On
error_log = /var/log/php_errors.log
EOF
else
echo "==> PHP-Debug-Modus deaktiviert"
cat > "$PHP_INI_DIR/99-adminserv-debug.ini" <<EOF
display_errors = Off
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
log_errors = On
error_log = /var/log/php_errors.log
EOF
fi
echo "Starting apache server"
service apache2 start