PhpStorm 2020+phpstudyV 8+XDebug 의 튜 토리 얼 상세 설명
7385 단어 PhpStorm2020phpstudyV8XDebug
1.phpStudy 설치
1.1,phpStudy 다운로드
다운로드 주소:www.xp.cn/
압축 을 풀 고 exe 를 실행 하여 설치 합 니 다.제 설치 디 렉 터 리 는 D:\phpstudy 입 니 다.pro
1.2.환경 설정:
데스크 톱 에서 작은 가죽 을 시작 하여 설정 합 니 다.제 설정 은 다음 과 같 습 니 다.
첫 페이지 패 널:"WNMP"시작

웹 사이트 패 널:PHP 버 전

환경 패 널:데이터베이스,PHP 실행 환경

2,설치 PhpStorm 2020
2.1,phpStudy 다운로드
다운로드 주소:https://blog.jetbrains.com/phpstorm/2020/03/phpstorm-2020-1-beta/
내 가 사용 하 는 것 은 부족 한 디 렉 터 리 를 설치 하 는 것 인 데,어떻게 활성화 하 는 지 는 자세히 말 하지 않 겠 다.
2.1 PHP 버 전 정보 설정
우 리 는"File->Settings"메뉴 를 클릭 하여 PHP 버 전 설정 을 하고,phpstudy 에 대응 하 는 버 전 PHP 7.3.4 를 사용 합 니 다.

메모:Interpreter 는 기본적으로 없습니다.오른쪽 단 추 를 누 르 면 설정 해 야 합 니 다.


3.새로운 테스트 프로젝트
3.1,PhpStorm 새 프로젝트"HelloPHP"사용
첫 번 째 단계:PhpStorm 소프트웨어 를 열 고 새 항목 을 만 들 려 면 누 르 십시오.입력 상자 에 항목 저장 주소 가 있 는 항목 의 이름 을 입력 하고 완료 후 만 들 려 면 누 르 십시오.

3.2 프로젝트 의 로 컬 서비스 설정
"도구/배치/설정"메뉴 를 누 르 면 로 컬 서비스 설정 을 진행 합 니 다.



확인 을 클릭 하여 구체 적 인 설정 을 진행 합 니 다:
연결 패 널:배치 디 렉 터 리 설정

Mappings 패 널:상대 디 렉 터 리 와 접근 주 소 를 설정 합 니 다.

설정 이 끝 난 후"확인"을 누 르 십시오.
3.3 운영 환경 설정
'설정 실행/편집'메뉴 를 누 르 면 환경 설정 을 실행 합 니 다.



3.4,PHP 파일 생 성
프로젝트 를 선택 하고 오른쪽 단 추 를 누 르 십시오->New->PHP 파일

파일 이름 을 입력 하고,확인 을 누 르 면 PHP 파일 을 추가 합 니 다

새 파일 에 코드 입력:
<?php
echo "Hello PHP!"; // “Hello PHP!”
phpinfo(); // PHP PHP
3.5.배치 공정메뉴 에서 Tools->Deployment->Upload to localhost 업로드 프로젝트 를 선택 하 십시오.

업로드 에 성공 하면 아래 콘 솔 에 올 린 구체 적 인 정 보 를 표시 합 니 다.

phpstudy 의 www/HelloPHP 디 렉 터 리 에서 방금 올 린 Index.php 파일 을 찾 을 수 있 습 니 다.

3.6,Hello PHP 실행
페이지 에 떠 있 는 브 라 우 저 실행 페이지 를 클릭 하 십시오.

효과 좀 봅 시다.

지금까지 우 리 는 PHPStudy+PHPStorm 설정 과 HelloPHP 실행 을 완 료 했 습 니 다.그러나 지금까지 PHPStorm 은 편집기 와 배치 기능 만 맡 았 을 뿐 직접 디 버 깅 할 수 없습니다.다음은 PHPStorm 에서 단일 디 버 깅 을 완성 하 겠 습 니 다.
4、디 버 깅 Hello PHP
4.1 브 라 우 저 와 플러그 인
1)브 라 우 저 는 chrome 을 사용 하여 주 소 를 다운로드 합 니 다.https://www.google.com/chrome/;
2)chrome 플러그 인 에 맞 춰 xdebug 를 사용 합 니 다.설치 가 완료 되면 브 라 우 저 주소 표시 줄 오른쪽 에 작은 파충류 한 마 리 를 볼 수 있 습 니 다.클릭 하면 다음 그림 과 같 습 니 다.

Debug 를 선택 하면 개발 환경 에 디 버 깅 을 하고 disable 을 선택 하면 바로 실 행 됩 니 다.
xdebug helper 에서 설정 할 수 있 습 니 다.phpstorm 을 선택 하고 오른쪽 상자 에 phpstorm-xdebug 를 채 울 수 있 습 니 다.


여기까지 phpstorm 에서 정지점 을 설정 한 다음 브 라 우 저의 xdebug helper 를 사용 하여 페이지 디 버 깅 을 시작 할 수 있 습 니 다.
4.2 php.ini 파일 의 끝 에 다음 설정 을 추가 합 니 다.
[Xdebug]
zend_extension=D:/phpstudy_pro/Extensions/php/php7.3.4nts/ext/php_xdebug.dll
xdebug.collect_params=1
xdebug.collect_return=1
xdebug.auto_trace=On
xdebug.trace_output_dir=D:/phpstudy_pro/Extensions/php_log/php7.3.4nts.xdebug.trace ;
;xdebug.profiler_enable=On ;
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir="D:\phpstudy_pro\Extensions\tmp\xdebug" ;profiler_enable 1 ,
xdebug.remote_host = "localhost"
xdebug.remote_port=9090
xdebug.remote_handler="dbgp"
xdebug.profiler_append = 0
xdebug.remote_enable=On
xdebug.idekey=phpstorm-xdebug
xdebug.profiler_output_name ="cache.out.%t-%s" ;
4.3,PhpStorm 에 Debug 설정:1)File->Settings->Languages&Frameworks->PHP>Debug 를 선택 하고 XDebug 옵션 카드 를 찾 습 니 다.Debug port 는 방금 php.ini 설정 파일 에 xdebug.remote 를 입력 했 습 니 다.port 의 값,구체 적 인 설정 은 다음 그림 과 같 습 니 다:

2)파일->설정->언어&프레임 워 크->PHP->디버그->DBGp 프 록 시 를 선택 하고,
IED key 는 php.ini 파일 의 xdebug.idekey 값 을 입력 합 니 다.Host,Port 는 File->Settings->Languages&Frameworks->PHP->Servers 에서 설정 한 Host,Port 값 입 니 다.구체 적 인 설정 은 다음 그림 과 같 습 니 다.

4.4,XDebug 디 버 깅 시작
phpStorm 에서 감청 을 켜 면 전화 와 같은 단 추 를 누 르 고 녹색 으로 변 합 니 다.프로그램 코드 점 앞에서 클릭 하고 프로그램 세그먼트 점 을 설정 하 며 녹색 debug 파충류 단 추 를 누 르 면 chrome 브 라 우 저 는 xdebug 페이지 를 엽 니 다.phpStorm 에 debug 창 이 나타 나 고 variables 값 을 가 져 옵 니 다.

5.오류 처리
5.1 PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
원인 1:
remote_port 는 9090 을 사용 합 니 다.기본적으로 9000 을 사용 합 니 다.9000 포트 가 nginx 에 의 해 에이전트 로 점용 되 기 때문에 점용 되면 php 가 디 버 깅 할 수 없습니다.
원인 2:
phpStudy 통합 XDebug 확장,PHP 확장 중 php 선택xdebug 시 상기 오류 가 발생 할 수 있 습 니 다.개인 분석:pp.ini 에 설 치 된 zend 때 문 일 수 있 습 니 다.extension 과 옵션 이 충돌 합 니 다.

PhpStorm 2020+phpstudyV 8+XDebug 의 튜 토리 얼 에 대한 자세 한 설명 은 여기까지 입 니 다.더 많은 PhpStorm 2020 phpstudyV 8 XDebug 내용 은 저희 의 이전 글 을 검색 하거나 아래 의 관련 글 을 계속 보 세 요.앞으로 많은 응원 부 탁 드 리 겠 습 니 다!