본문 바로가기
IT/PHP,WORDPRESS

Windows 에서 php 개발 환경 꾸미기

by 골든크랩 2023. 4. 4.
728x90
반응형

 

1. apache 다운로드 받아서 설치하기

https://www.apachelounge.com/download/

 

압축파일 풀어라.  난 httpd-2.4.56-win64-VS17.zip 다운로드 받음

httpd.conf 파일 열어서 

 

SRVROOT 설정

Define SRVROOT "C:/httpd-2.4.56-win64-VS17/Apache24"

끝.

 

2.  ApacheMonitor.exe 를 실행시키면, 오른쪽 tray에 Apache 서비스가 표시되는데....apache를 서비스로 install 시켜야 실행할수 있다.  3번.

    C:\httpd-2.4.56-win64-VS17\Apache24\bin

 

 

3.  cmd 창 관리자 권한으로 실행한 후 명령어 입력

1) 폴더 이동해준후 >> cd C:\httpd-2.4.56-win64-VS17\Apache24\bin

2) 설치 >>  httpd.exe -k install  

(아파치 삭제는  httpd.exe -k uninstall  )

**명령 프롬프트로 실행시 Syntax오류가 나타난다면 서비스로 등록하여 start를 하면 에러가 발생하기 때문에 httpd.conf Syntax가 정상적인지를 체크해야한다. 

3) >> httpd -n "Apache2.4" -t
4) >> httpd -k start

 

아파치 동작확인.  아래처럼 들어가면....

http://localhost/

 

아래 문자열 출력됨..썰렁함..ㅋㅋㅋ

It works!

 

4. php 다운로드 하기

https://windows.php.net/download/

 

7.4.33 Thread Safe 로 다운 받음.

압축을 푼 디렉토리는 C:\php-7.4.33-Win32-vc15-x64

 

5. php.ini 파일 만들어 수정하기

php.ini-production 파일을 복사해서 파일명을 php.ini 로 변경하고 수정함.

step1

     ; extension_dir = "./"   을 찾아서 ; (주석) 지워준다.

 

step2 

extension_dir = "C:/php-7.4.33-Win32-vc15-x64/ext"

  경로를 입력해준다. 

 

 

6.

httpd.conf  파일을 다시 열어주고,  DirectoryIndex에 index.php을 추가한다

그리고 파일 끝에 아래 내용 추가.

LoadModule php7_module "C:/php-7.4.33-Win32-vc15-x64/php7apache2_4.dll"
AddType application/x-httpd-php .html .php
AddHandler application/x-httpd-php .php

 

8.최종.

phpinfo 파일을 C:\httpd-2.4.56-win64-VS17\Apache24\htdocs 만들고

 

<?php

phpinfo();

?>

 

아파치 재구동하고  크롬에서 접속해보면 된다.  

http://localhost/phpinfo.php

 

 

디버거 설정하기....디버거 파일을 다운로드 받아야 함.

php.ini 파일에 아래 내용 추가할것

[xDebug]
zend_extension = C:/php-7.4.33-Win32-vc15-x64/ext/php_xdebug-3.1.6-7.4-vc15-x86_64.dll
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\php-7.4.33-Win32-vc15-x64\templog"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "C:\php-7.4.33-Win32-vc15-x64\templog"

 

https://xdebug.org/download/historical

 

Xdebug: Historical Releases

Historical Releases This page lists downloads for all historical Xdebug releases. Please always use the latest release. If you don't know which one you need, please refer to the custom installation instructions. Xdebug 3.2.1 Release date: 2023-03-21 Xdebug

xdebug.org

참고)

https://mysql.tistory.com/23

 

PhpStorm IDE에서 Xdebug 설치 및 설정 방법

자바의 intellij와 다르게 php는 디버깅을 하기 위해 Xdebug 확장 모듈을 설치해야 하고 몇 가지 설정이 필요합니다. ​ 먼저 결과 화면입니다. php 소스코드에서 중단점을 걸면 해당 부분에서 break가

mysql.tistory.com

 

 

 

 

참조글)

https://subin-0320.tistory.com/125

 

[PHP] PHP Storm 설정

PHP 설치를 완료했으니 PHP IDE 중 하나인 PHP Storm을 사용해 PHP에 대한 학습을 시작해보려 합니다! 만약, PHP 설치에 관한 내용이 궁금하시다면 아래 링크를 참고해주세요! [PHP] Bitnami로 PHP 환경 세팅

subin-0320.tistory.com

 

https://fifo22.tistory.com/34

 

윈도우10 Window10 환경에서 Apache, PHP 설치하기

다른 블로그 보고 따라하다가 경로, 윈도우 비트 달라서 개뻘짓해서 빡쳐서 쓴는 글 내 컴퓨터가 win 64비트인지 확인해야함 이건 철저히 win 64비트를 위한 글임 1. 먼저 아파치 설치 https://www.apache

fifo22.tistory.com

 

728x90
반응형

댓글