본문 바로가기

dev

[php] 디버깅

phpinfo()를 ctrl+a로 싹 긁어서 넣음

https://xdebug.org/wizard

 

 

  1. 파일 받아서 ext에 넣고 이름바꾸는건 자유

php.ini에 맨아래에 xdebug 옵션들 추가

[xdebug]
zend_extension="c:\Bitnami\wampstack-8.1.12-0\php\ext\php_xdebug.dll"
; Enable communications using DBGp protocol
xdebug.mode=develop
xdebug.start_with_request=yes
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9000

마지막줄의 포트는 디버깅을 위한 포트라 바꿀필요없다고함 (기본은 9003이라고함)

VSC 켜서 디버깅탭의 설정눌러서 launch.json의 포트도 9000으로 맞춰줌

중단점찍고 로드하면 디버깅 성공!

 

+ ssh 원격서버의 디버깅설정 : https://velog.io/@blatter95/vscode-php-debug