티스토리 뷰

[업데이트 2017.02.01 21:00]

 

cURL로 GET/PUT/POST/DELETE에 대해 REST API 테스트 환경을 구축 후, 해당 http request가 발생 할 때 마다 자동으로 xDebug가 실행되도록 설정을 하고 싶었는데, 아래와 같이 xdebug.remote_autostart를 1로 설정하면 쉽게 디버깅이 가능했습니다.

xdebug.remote_autostart=1

<PHP.INI파일에서 xDebug설정>

xdebug.extended_info=1
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.profiler_enable=true
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000

다음과 같이 cURL을 통해 다음과 같이 PUT http request를 수행하였을 때, Eclipse Neon2에서 자동으로 xDebug가 수행됨을 확인 할 수 있습니다.

C:\>curl -X PUT "http://192.168.0.1/users/admin/1" --data "{\"user\":\"dev_admin\"}"

아래와 같이 debugging breakpoint가 걸렸음을 확인 할 수 있습니다.

 

 

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함