동적 웹페이지용 언어

Aparche를 설치한 뒤 진행하실 수 있습니다.


1. PHP 설치

서버 측 스크립트 언어 PHP를 설치해보자.

PHP For Windows: Binaries and sources Releases

위 링크를 통해 설치 가능하다. Thread Safe 버전으로 zip 파일을 설치 후 압축을 푼다.

2. PHP 환경설정 변경

다음을 차례로 변경한다.

  1. php.ini-production⇒php.ini 파일 이름 및 확장자 변경

  2. php.ini 파일(메모장으로 열기) 내 198번 줄 변경

    short_open_tag = Off→On

  3. 486번 줄 변경

    error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT→E_ALL & ~E_NOTICE

  4. 764~765번 줄 변경(맨 앞 ; 제거 확인, 현재 ext경로로 변경)

    ; On windows: ;extension_dir = "ext"

    On windows: extension_dir = "D:\workspaces\php\ext"

  5. 930, 936번 줄 변경(MySQL과 연동하기 위함)

    ;extension=mysqli, ;extension=pdo_mysql 앞 주석(;) 제거

  6. 저장 후 종료

php.ini

3. PHP Apache 연동

Apache24폴더 > conf폴더 > httpd.conf 추가 변경 사항

  1. 285번째 줄 DirectoryIndex index.html ⇒ DirectoryIndex index.php index.html
  2. 파일 맨 뒤에 다음을 추가