Pages

October 27, 2010

ใช้งาน Xdebug ร่วมกับ netbeans แบบง่ายๆด้วย Easy Xdebug ( firefox addon )

Easy Xdebug เป็น Firefox add-on ตัวหนึ่งที่ทำให้เราสามารถจัดการใช้งาน xdebug กับ เว็บไซต์ที่มีการใช้งาน .htaccess เพื่อย่อ url เช่นใน codeigniter ให้สามารถทำงานได้ง่ายๆโดยไม่ต้องไปปรับแก้ไข .htaccess ให้วุ่นวายอีกต่อไป

สิ่งที่ต้องมี
  1. Netbeans ( ที่ใช้คือ 6.9 )
  2. Firefox ที่ติดตั้ง Easy Xdebug add-on
    ( https://addons.mozilla.org/en-US/firefox/addon/58688/ )
  3. เซิฟเวอร์ที่ติดตั้ง Xdebug แล้ว

 วิธีการ
  1. ปรับโปรเจกใน netbeans ให้เหมาะกับการทำงาน โดยไปที่
    คลิกขวาที่ ชื่อโปรเจ็ก -> Properties -> Run Configuration -> Advanced -> เลือก "Do Not Open Web Browser"
  2. ทำการลองใส่ Break point เพื่อทดสอบการทำงาน จากนั้น ทำการสั่ง Debug Project
  3. ทำการเปิดให้ Easy Xdebug ทำงานโดยคลิกที่ icon ของ Easy Xdebug ใน firefox โดยจะมีให้เลือกสองแบบ คือ session และ profiler ( เมื่อทำงานจะเป็นสีแดง )
  4. ทำการเปิดหน้า Web-site ที่เรากำลัง Debug อยู่ในขณะนี้
  5. หลังจากที่เปิด Web-site แล้วจะพบว่า Netbeans เริ่มทำการ Debug แล้ว
เสริม

ค่า config สำหรับ php.ini สำหรับการติดตั้ง Xdebug ลงใน XAMPP
; สำหรับ php 5.3 ขึ้นไป
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
; สำหรับ php ที่ต่ำกว่า 5.3
; zend_extension_ts = "C:\xampp\php\ext\php_xdebug.dll"

[xdebug]
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp 

1 comment:

  1. Slot Machine Locations - MapyRO
    Slot 전라남도 출장안마 Machines in Arizona. The main reason why slot machine locations are hard to 대전광역 출장안마 come by is because it 천안 출장마사지 is the easiest and 목포 출장샵 most convenient way 밀양 출장안마 to locate

    ReplyDelete