diff --git a/src/phpDebug.ts b/src/phpDebug.ts index a04eed72..2ea84183 100644 --- a/src/phpDebug.ts +++ b/src/phpDebug.ts @@ -414,6 +414,9 @@ class PhpDebugSession extends vscode.DebugSession { throw new Error('Cannot have port and socketPath set at the same time') } if (args.hostname?.toLowerCase()?.startsWith('unix://') === true) { + if (fs.existsSync(args.hostname.substring(7))) { + throw new Error(`File ${args.hostname.substring(7)} exists and cannot be used for Unix Domain socket`) + } server.listen(args.hostname.substring(7)) } else if (args.hostname?.startsWith('\\\\') === true) { server.listen(args.hostname)