XAMPP เปิดไม่ได้ขึ้น Port 80 in use by "Unable to open process" with PID 9752!

เนื่องจากผมต้องการใช้เครื่องคอมผมเองเป็น server จึงต้องมีการเป็นโปรแกรม XAMPP ขึ้นมาแต่ก็เนื่องด้วยไม่ค่อยได้ใช้บ่อย และติดตั้งเล่นนั้นนี้ไปเรื่อยๆ จนทำให้บางงานบางพอร์ต มันตีกันครับ โอเคไปดูปัญหาและวิธีแก้ไขกันเลย

ภาพ error ที่ผมเจอ

|23:02:22  [Apache] |Port 443 in use by C:\Program Files (x86)\VMware\VMware Workstation\vmware-hostd.exe -u C:\ProgramData\VMware\hostd\config.xml with PID 9004!|
|---|---|
|23:02:22  [Apache] |Apache WILL NOT start without the configured ports free!|
|23:02:22  [Apache] |You need to uninstall/disable/reconfigure the blocking application|
|23:02:22  [Apache] |or reconfigure Apache and the Control Panel to listen on a different port|
|23:02:22  [Apache] |Attempting to start Apache app...|
|23:02:22  [Apache] |Status change detected: running|
|23:02:23  [Apache] |Status change detected: stopped|
|23:02:23  [Apache] |Error: Apache shutdown unexpectedly.|
|23:02:23  [Apache] |This may be due to a blocked port, missing dependencies, |
|23:02:23  [Apache] |improper privileges, a crash, or a shutdown by another method.|
|23:02:23  [Apache] |Press the Logs button to view error logs and check|
|23:02:23  [Apache] |the Windows Event Viewer for more clues|
|23:02:23  [Apache] |If you need more help, copy and post this|
|23:02:23  [Apache] |entire log window on the forums|

ในกรณีที่ 1 พบว่า โปรแกรม VMware มันไปจองพอร์ต 443 ไว้ แต่ตอนนี้ส่วนใหญ่ผมไม่ได้ใช้แล้ว ผมจึงเข้าไปหยุดมัน และถอดการติดตั้งออกไปเลยดีกว่า ก็ให้เข้าไปที่ Task Manager เลือกแทบ services เลื่อนหา port 9004 แล้วกดหยุด

กรณีที่ 2 ยังไม่จบผมยังเจอ error

|23:05:31  [Apache] |Port 80 in use by Unable to open process with PID 9752!|
|---|---|
|23:05:31  [Apache] |Apache WILL NOT start without the configured ports free!|
|23:05:31  [Apache] |You need to uninstall/disable/reconfigure the blocking application|
|23:05:31  [Apache] |or reconfigure Apache and the Control Panel to listen on a different port|
|23:05:31  [Apache] |Attempting to start Apache app...|
|23:05:31  [Apache] |Status change detected: running|
|23:05:32  [Apache] |Status change detected: stopped|
|23:05:32  [Apache] |Error: Apache shutdown unexpectedly.|
|23:05:32  [Apache] |This may be due to a blocked port, missing dependencies, |
|23:05:32  [Apache] |improper privileges, a crash, or a shutdown by another method.|
|23:05:32  [Apache] |Press the Logs button to view error logs and check|
|23:05:32  [Apache] |the Windows Event Viewer for more clues|
|23:05:32  [Apache] |If you need more help, copy and post this|
|23:05:32  [Apache] |entire log window on the forums|

ถ้าเราไม่รู้ว่าใครไปจองพอร์ต 80 ของเราก็ให้ใช้ค้นหาเครื่องมือจากช่องค้นหาชื่อ Resource Monitor ก็จะรู้ว่าใครใช้อยู่

ไปที่ Task Manager อีกครั้ง แล้วเลื่อนหาชื่อ nginx services แล้วก็จบชีวิตมันซะ

กลับมาเปิด XAMPP อีกครั้งเป็นอันใช้ได้