本文共 5848 字,大约阅读时间需要 19 分钟。
【问题】
刚刚遇到了一个问题:在安装了集成环境,XAMPP后,发现我的apahce服务无法启动。如图1所示。
【思路】
查找80端口的使用情况。如下图所示,会发现80端口被程序“Thunder5.exe”(迅雷)占用。
【解决】
关闭迅雷。
【延伸思考】
当我们系统的端口被占用的时候,需要做的和本案例类似,首先查询占用端口的程序,在上图中我们可以看到,迅雷的PID,其实除了可以手动关闭对应的程序外,还可以通过杀死对应的进程来实现。
杀死进程:
【延伸阅读】
xp下还有两个好东东tasklist和tskill。tasklist能列出所有的进程,和相应的信息。tskill能查杀进程,语法很简单:tskill 程序名!!
NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]
-a 显示所有连接和监听端口。
-b 显示包含于创建每个连接或监听端口的 可执行组件。在某些情况下已知可执行组件 拥有多个独立组件,并且在这些情况下 包含于创建连接或监听端口的组件序列 被显示。这种情况下,可执行组件名 在底部的 [] 中,顶部是其调用的组件, 等等,直到 TCP/IP 部分。注意此选项 可能需要很长时间,如果没有足够权限 可能失败。 -e 显示以太网统计信息。此选项可以与 -s 选项组合使用。 -n 以数字形式显示地址和端口号。 -o 显示与每个连接相关的所属进程 ID。 -p proto 显示 proto 指定的协议的连接;proto 可以是 下列协议之一: TCP、UDP、TCPv6 或 UDPv6。 如果与 -s 选项一起使用以显示按协议统计信息,proto 可以是下列协议之一: IP、IPv6、ICMP、ICMPv6、TCP、TCPv6、UDP 或 UDPv6。 -r 显示路由表。 -s 显示按协议统计信息。默认地,显示 IP、 IPv6、ICMP、ICMPv6、TCP、TCPv6、UDP 和 UDPv6 的统计信息; -p 选项用于指定默认情况的子集。 -v 与 -b 选项一起使用时将显示包含于 为所有可执行组件创建连接或监听端口的 组件。 interval 重新显示选定统计信息,每次显示之间 暂停时间间隔(以秒计)。按 CTRL+C 停止重新 显示统计信息。如果省略,netstat 显示当前 配置信息(只显示一次)附:NTSD 中所附的帮助文件
usage: ntsd [-?] [-2] [-d] [-g] [-G] [-myob] [-lines] [-n] [-o] [-s] [-v] [-w]
[-r BreakErrorLevel] [-t PrintErrorLevel] [-hd] [-pd] [-pe] [-pt #] [-pv] [-x | -x{e|d|n|i} ] [-- | -p pid | -pn name | command-line | -z CrashDmpFile] [-zp CrashPageFile] [-premote transport] [-robp] [-aDllName] [-c "command"] [-i ImagePath] [-y SymbolsPath] [-clines #] [-srcpath SourcePath] [-QR machine] [-wake ] [-remote transport:server=name,portid] [-server transport:portid] [-ses] [-sfce] [-sicv] [-snul] [-noio] [-failinc] [-noshell]where: -? displays this help text
command-line is the command to run under the debugger – is the same as -G -g -o -p -1 -d -pd -aDllName sets the default extension DLL -c executes the following debugger command -clines number of lines of output history retrieved by a remote client -failinc causes incomplete symbol and module loads to fail -d sends all debugger output to kernel debugger via DbgPrint -d cannot be used with debugger remoting -d can only be used when the kernel debugger is enabled -g ignores initial breakpoint in debuggee -G ignores final breakpoint at process termination -hd specifies that the debug heap should not be used for created processes. This only works on Windows Whistler. -o debugs all processes launched by debuggee -p pid specifies the decimal process Id to attach to -pd specifies that the debugger should automatically detach -pe specifies that any attach should be to an existing debug port -pn name specifies the name of the process to attach to -pt # specifies the interrupt timeout -pv specifies that any attach should be noninvasive -r specifies the (0-3) error level to break on (SeeSetErrorLevel) -robp allows breakpoints to be set in read-only memory -t specifies the (0-3) error level to display (SeeSetErrorLevel) -w specifies to debug 16 bit applications in a separate VDM -x sets second-chance break on AV exceptions -x{e|d|n|i} sets the break status for the specified event -2 creates a separate console window for debuggee -i ImagePath specifies the location of the executables that generated the fault (see _NT_EXECUTABLE_IMAGE_PATH) -lines requests that line number information be used if present -myob ignores version mismatches in DBGHELP.DLL -n enables verbose output from symbol handler -noio disables all I/O for dedicated remoting servers -noshell disables the .shell (!!) command -QR queries for remote servers -s disables lazy symbol loading -ses enables strict symbol loading -sfce fails critical errors encountered during file searching -sicv ignores the CV record when symbol loading -snul disables automatic symbol loading for unqualified names -srcpath specifies the source search path -v enables verbose output from debugger -wake wakes up a sleeping debugger and exits -y specifies the symbol search path (see _NT_SYMBOL_PATH) -z specifies the name of a crash dump file to debug -zp specifies the name of a page.dmp file to use with a crash dump -remote lets you connect to a debugger session started with -server must be the first argument if present transport: tcp | npipe | ssl | spipe | 1394 | com name: machine name on which the debug server was created portid: id of the port the debugger server was created on for tcp use: port= for npipe use: pipe= for 1394 use: channel= for com use: port=,baud=, channel= for ssl and spipe see the documentation example: … -remote npipe:server=yourmachine,pipe=foobar -server creates a debugger session other people can connect to must be the first argument if present transport: tcp | npipe | ssl | spipe | 1394 | com portid: id of the port remote users can connect to for tcp use: port= for npipe use: pipe= for 1394 use: channel= for com use: port=,baud=, channel= for ssl and spipe see the documentation example: … -server npipe:pipe=foobar -premote transport specifies the process server to connect to transport arguments are given as with remotingEnvironment Variables:
_NT_SYMBOL_PATH=[Drive:][Path]
Specify symbol image path._NT_ALT_SYMBOL_PATH=[Drive:][Path]
Specify an alternate symbol image path._NT_DEBUGGER_EXTENSION_PATH=[Drive:][Path]
Specify a path which should be searched first for extensions dlls_NT_EXECUTABLE_IMAGE_PATH=[Drive:][Path]
Specify executable image path._NT_SOURCE_PATH=[Drive:][Path]
Specify source file path._NT_DEBUG_LOG_FILE_OPEN=filename
If specified, all output will be written to this file from offset 0._NT_DEBUG_LOG_FILE_APPEND=filename
If specified, all output will be APPENDed to this file._NT_DEBUG_HISTORY_SIZE=size
Specifies the size of a server’s output history in kilobytesControl Keys:
Quit debugger
Break into Target Force a break into debuggee (same as Ctrl-C) Debug Current debugger Toggle Verbose mode Print version information ntsd: exiting – press enter —本文转自tiancong 51CTO博客,原文链接:http://blog.51cto.com/tiancong/685901
转载地址:http://gyqrl.baihongyu.com/