ติด error ยาวๆ ประมาณนี้
`11:19:52 AM [Apache] Error: Apache shutdown unexpectedly.`
`11:19:52 AM [Apache] This may be due to a blocked port, missing dependencies,`
`11:19:52 AM [Apache] improper privileges, a crash, or a shutdown by another method.`
`11:19:52 AM [Apache] Press the Logs button to view error logs and check`
`11:19:52 AM [Apache] the Windows Event Viewer for more clues`
`11:19:52 AM [Apache] If you need more help, copy and post this`
`11:19:52 AM [Apache] entire log window on the forums`
นั่นหมายความว่า portที่ใช้ connect กับ Apache นั้น (โดยปกติเป็น port80) ถูกappอื่นใช้ไปแล้วเพราะฉะนั้น วิธีแก้ คือเราต้องเปลี่ยนportที่ใช้ connect กัย Apache ซะ
แก้ไขโดยเข้า XAMPP control panel ตรง apache เลือก "Config" option แล้วก็เลือกอันแรกเลย (httpd.conf):
พอไฟล์ httpd.conf ถูกเปิดขึ้นมา ให้เราหาบรรทัดที่เขียนไว้ว่า "Listen 80"
แก้ Listen 80 เป็น Listen 1337 (เปลี่ยนจากport 80 เป็น port 1337)
กด save file เท่านี้เราก็สามารถ start Apace ได้แล้ว
แต่นั้นหมายความว่า เวลาเราเข้า localhost เราก็ต้องเปลี่ยนเป็น localhost:1337 แทนนะจ๊ะ
มีวิธีการอื่นอีกไหมค่ะพอดีว่าลองทำตามทุกอย่างแล้วแต่ก็ยังไม่ได้ผลอ๊ะค่ะ ยังคงไม่startอยู่เดิมอ๊ะค่ะ
ตอบลบลองใช้คำสั่ง netstat -aon ใน cmd เพื่อเช็คดูว่า Port ไหนถูกใช้ไปแล้วบ้าง (ดูที่ Address)
ตอบลบลองเช็คดูค่ะว่ามีAppอื่นใช้ Port ::1337 ไปแล้วหรือยัง ถ้ามีแล้ว ให้ตั้งค่า XAMPP เลี่ยงไปใช้ Port อื่นเอา
หรือถ้ายังไงลองเปลี่ยนไปใช้ Port 8080 ดูก็ได้ค่ะ
ขอบคุณมากค่ะ :))
ตอบลบhttpd.conf ถูกเปิดขึ้นมา มันไม่เป็นภาษาอังกฤษค่ะแก้ยังงัยคะ หา"Listen 80"ไม่พบ
ตอบลบกด ctrl f แล้วพิม:80ดูค่ะ
ลบ