diff --git a/src/Commands/StartCommand.php b/src/Commands/StartCommand.php index 5ff5f1db0..ae683b75b 100644 --- a/src/Commands/StartCommand.php +++ b/src/Commands/StartCommand.php @@ -29,6 +29,7 @@ class StartCommand extends Command implements SignalableCommandInterface {--caddyfile= : The path to the FrankenPHP Caddyfile file} {--https : Enable HTTPS, HTTP/2, and HTTP/3, and automatically generate and renew certificates [FrankenPHP only]} {--http-redirect : Enable HTTP to HTTPS redirection (only enabled if --https is passed) [FrankenPHP only]} + {--server-debug : Enable debug mode for the selected server [FrankenPHP only]} {--watch : Automatically reload the server when the application is modified} {--poll : Use file system polling while watching in order to watch files over a network} {--log-level= : Log messages at or above the specified log level}'; @@ -112,6 +113,7 @@ protected function startFrankenPhpServer() '--caddyfile' => $this->option('caddyfile'), '--https' => $this->option('https'), '--http-redirect' => $this->option('http-redirect'), + '--server-debug' => $this->option('server-debug'), '--watch' => $this->option('watch'), '--poll' => $this->option('poll'), '--log-level' => $this->option('log-level'), diff --git a/src/Commands/StartFrankenPhpCommand.php b/src/Commands/StartFrankenPhpCommand.php index 60f216009..9d0990ac4 100644 --- a/src/Commands/StartFrankenPhpCommand.php +++ b/src/Commands/StartFrankenPhpCommand.php @@ -33,6 +33,7 @@ class StartFrankenPhpCommand extends Command implements SignalableCommandInterfa {--caddyfile= : The path to the FrankenPHP Caddyfile file} {--https : Enable HTTPS, HTTP/2, and HTTP/3, and automatically generate and renew certificates} {--http-redirect : Enable HTTP to HTTPS redirection (only enabled if --https is passed)} + {--server-debug : Enable debug mode} {--watch : Automatically reload the server when the application is modified} {--poll : Use file system polling while watching in order to watch files over a network} {--log-level= : Log messages at or above the specified log level}'; @@ -95,7 +96,11 @@ public function handle(ServerProcessInspector $inspector, ServerStateFile $serve 'LARAVEL_OCTANE' => 1, 'MAX_REQUESTS' => $this->option('max-requests'), 'REQUEST_MAX_EXECUTION_TIME' => $this->maxExecutionTime(), - 'CADDY_GLOBAL_OPTIONS' => ($https && $this->option('http-redirect')) ? '' : 'auto_https disable_redirects', + 'CADDY_GLOBAL_OPTIONS' => trim(sprintf( + "%s\n%s", + $this->option('server-debug') ? 'debug' : '', + $https && $this->option('http-redirect') ? '' : 'auto_https disable_redirects', + )), 'CADDY_SERVER_ADMIN_PORT' => $this->adminPort(), 'CADDY_SERVER_LOG_LEVEL' => $this->option('log-level') ?: (app()->environment('local') ? 'INFO' : 'WARN'), 'CADDY_SERVER_LOGGER' => 'json',