기본 콘텐츠로 건너뛰기

Nginx + PHP + MySQL 개발 및 배포 환경 구축 (4)

Windows 10 64bit 환경에서 PHP 7.2 설치하기

목차로 돌아가기

1. PHP 7.2 설치하기

VC15 x64 Non Thread Safe 내려받아 D:\Utils 폴더에 압축을 푼다.

D:\Utils\php-7.2.7-nts-Win32-VC15-x64 >

PHP-FPM 설정을 위해 php.ini 설정파일을 편집한다. php.ini 파일은 C\Windows 폴더에 기본적으로 위치한다. PHP FastCGI Process Manager (FPM)은 로드가 많은 사이트에 유용한 설정으로 앞서 설치한 nginx와 함께 사용할 수 있도록 nginx 설정 파일도 함께 편집한다.

;C:\Windows\php.ini

engine = Off

memory_limit = 1G

extension_dir = "ext" ; for windows

cgi.force_redirect = 0
cgi.fix_pathinfo=0

; PHP 7.2 이전 버전
; extension=php_extname
; PHP 7.2 부터 확장 모듈명만 기재
; extenstion=extname
extension=curl
extension=gd2
extention=mbstring
extention=exif
extention=mysqli

; php_oci8_12c.dll은 Oracle C interface의 일부이므로 Oracle instant client가 설치되어 있어야 한다.
extention=oci8_12c

extention=openssl

[Date]
date.timezone = Asia/Seoul

2. php-cgi.exe 실행

D:\Utlis\php-7.2.7-nts-Win32-VC15-x64> php-cgi.exe -b 127.0.0.1:9000

3. nginx.conf 설정

location ~ \.php$ {
  root           html;
  fastcgi_pass   127.0.0.1:9000;
  fastcgi_index  index.php;
  include        fastcgi.conf 
  #fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  #include        fastcgi_params;
}

4. PEAR 패키지 관리자 설치하기

PHP를 다운받아 설치한 후, 웹브라우저에서 https://pear.php.net/go-pear.phar를 다운로드받아서 go-pear.phar라는 파일을 PHP 설치 폴더에 저장하여 실행한다. C:\Windows 폴더 내에 pear.ini를 복사하고 php.ini를 편집하는 과정이 진행되므로 관리자 권한으로 명령프롬프트를 실행하여 진행한다.

D:\Utlis\php-7.2.7-nts-Win32-VC15-x64>php go-pear.phar [ENTER]
Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : [ENTER]

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

1. Installation base ($prefix)                   : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64
2. Temporary directory for processing            : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\tmp
3. Temporary directory for downloads             : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\tmp
4. Binaries directory                            : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64
5. PHP code directory ($php_dir)                 : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\pear
6. Documentation directory                       : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\docs
7. Data directory                                : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\data
8. User-modifiable configuration files directory : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\cfg
9. Public Web Files directory                    : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\www
10. System manual pages directory                 : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\man
11. Tests directory                               : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\tests
12. Name of configuration file                    : C:\Windows\pear.ini
13. Path to CLI php.exe                           : D:\Utlis\php-7.2.7-nts-Win32-VC15-x86

1-13, 'all' or Enter to continue: [ENTER]
Beginning install...
Configuration written to C:\Windows\pear.ini...
Initialized registry...
Preparing to install...
installing phar://D:/Utlis/php-7.2.7-nts-Win32-VC15-x64/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.4.3.tar...
installing phar://D:/Utlis/php-7.2.7-nts-Win32-VC15-x64/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.4.1.tar...
installing phar://D:/Utlis/php-7.2.7-nts-Win32-VC15-x64/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.10.5.tar...
installing phar://D:/Utlis/php-7.2.7-nts-Win32-VC15-x64/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.1.1.tar...
installing phar://D:/Utlis/php-7.2.7-nts-Win32-VC15-x64/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.4.2.tar...
install ok: channel://pear.php.net/Archive_Tar-1.4.3
install ok: channel://pear.php.net/Console_Getopt-1.4.1
install ok: channel://pear.php.net/Structures_Graph-1.1.1
install ok: channel://pear.php.net/XML_Util-1.4.2
install ok: channel://pear.php.net/PEAR-1.10.5
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR''s PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
<D:\Utils\php-7.2.7-nts-win32-vc15-x64\pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.


Would you like to alter php.ini <C:\Windows=php.ini>? [Y/n] : [ENTER]

php.ini <C:\Windows=php.ini> include_path updated.

Current include path           : .;C:\php\pear
Configured directory           : D:\Utlis\php-7.2.7-nts-Win32-VC15-x64\pear
Currently used php.ini (guess) : C:\Windows\php.ini
Press Enter to continue:

** WARNING! Old version found at D:\Utlis\php-7.2.7-nts-Win32-VC15-x64, please remove it or be sure to use the new d:\utlis\php-7.2.7-nts-win32-vc15-x64\pear.bat command

The 'pear' command is now at your service at d:\utlis\php-7.2.7-nts-win32-vc15-x64\pear.bat

** The 'pear' command is not currently in your PATH, so you need to
** use 'd:\utlis\php-7.2.7-nts-win32-vc15-x64\pear.bat' until you have added
** 'D:\Utlis\php-7.2.7-nts-Win32-VC15-x64' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

http://pear.php.net/faq.php
http://pear.php.net/manual/

Thanks for using go-pear!



* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under D:\Utlis\php-7.2.7-nts-Win32-VC15-x64PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

댓글

이 블로그의 인기 게시물

아두이노 미세먼지 센서 PM2008

온습도계를 달아봤으니 이참에 미세먼지까지 한꺼번에 표시되도록 기능을 추가해보기로 했다. 마침 아두이노 전용 쉴드까지 제공하는 미세먼지 센서가 눈에 띄길래 일단 구매를 해봤다. 배송받은 센서는 거의 완제품에 가깝게 제작되었다. 다만 아쉬운 점은 아두이노 전용 쉴드의 마감이 좀 지분하다는 느낌을 받았는데, 후처리에 신경을 더 써주는 센스가 부족한 듯. PC2008 미세먼지 센서 아두이노 우노 전용 PM2008 쉴드  부착한 상태는 핀 위치도 잘 맞고 비교적 깔끔한 느낌이다. 쉴드 덕분에 지저분한 배선이 줄어들어 다른 센서들을 붙이기에도 좋을 것 같다. 쉴드와 일체형으로 제작하지 않은 건 라즈베리 파이와 같은 다른 마이크로칩 보드용의 쉴드 제작을 염두에 둔 듯하다. Arduino UNO에 장착한 모습 센서의 작동 테스트를 위해 PM2008 I2C 라이브러리를 추가하여 샘플코드를 실행시켜봤다. 성공적을 테스트를 완료. 이제 공부가 남았을 뿐. Arduino library PM2008 I2C 설치

Adafuit HUZZAH ESP8266 보드를 이용한 Arduino IDE 환경설정하기

 Espressif社의 ESP8266 마이크로컨트롤러는 Arduino 보드에 사용된 AVR 마이크로컨트롤러와 같은 종류이다. 가장 큰 장점은 WiFi 통신이 가능하며, 별도의 추가적인 하드웨어 없이 펌웨어만으로 WiFi 클라이언트와 Access Point 기능을 제공한다는 점이다. 최근 중요한 이슈로 자리잡은 사물인터넷(IoT)을 구현하는데 더없이 좋은 마이크로컨트롤러라 할 수 있다. 게다가 저렴한 가격은 덤! (8,000 ~ 10,000원 정도이니 Arduino UNO 호환보드 가격이다.)  HUZZAH 보드의 특징을 간단히 살펴보면 다음과 같다. Adafruit HUZZAH ESP8266 ESP8266 칩(64KB RAM, 96KB data RAM, 4MB QIO FLASH) 리셋 버튼 프로그램을 업로드하는데 필요한 부트로딩 모드로 전환하기 위한 버튼 프로그래밍 가능한 RED UART 통신 기능 Analog 입력 1개 (최대 1V) GPIO 핀 9개 (3.3V), I2C와 SPI 이용 가능  프로그래밍을 위해 FTDI 연결이 필요하다. 프로그래밍은 Arduino IDE를 사용할 수 있으며, Arduino와 같이 C/C++ 코드를 이용하여 개발이 가능하다. 참고로 Epressif社의 ESP8266 개발보드인 NodeMCU는 루아(LUA)라는 프로그래밍언어를 기본 제공한다. Adafruit社의 HUZZAH 보드는 기본적으로 핀헤더 없이 반제품으로 판매되며 필요에 따라 핀헤더를 직접 납땜해서 부착해야한다. 핀헤더 및 USB 포트를 기본제공하는 개발보드 형태의 제품을 별도로 판매하고 있다. Arduino IDE를 이용하여 프로그래밍을 하기 위해서는 우선 라이브러리에 ESP8266 보드를 추가해야 한다. Arduino IDE에 ESP8266 애드온 설치하기 1. 환경설정에서 "추가적인 보드 매니저 URLs"에 다음 URL을 입력한다. http://arduino.esp8266.com/sta...

Eclipse + JBoss + jBPM 개발환경 설정

상용 개발환경인 JBoss Development Studio 9.0.0 GA 개발환경과 동일한 오픈소스 환경 구성을 목표 Windows 10 64bit JDK 1.8 64bit Eclipse Mars.1 64bit Wildfly 10 (JBoss Application Server) - JDK 1.8 지원 jBPM 6 1. JDK를 내려받아 설치한다. JDK 1.8 - Windows x64  http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 2. Eclipse을 내려받아 설치한다. 1) Eclipse IDE for Java EE Developers Windows 64bit 배포판을 내려받는다. http://www.eclipse.org/downloads/ 2) 적당한 디렉터리에 압축을 푼다. Ex) d:\eclipse 3) 압축을 풀어낸 디렉터리에서 eclipse.ini를 찾아 jdk bin 디렉터리의 javaw.exe를 설정한다. [eclipse.ini] -vm C:/Program Files/Java/jdk1.8.0_65/bin/javaw.exe 3. Wildfly를 내려받아 설치한다. 1) Wildfly 10.0.0 최신버전을 내려받는다. http://wildfly.org/downloads/ 2) 적당한 디렉터리에 압축을 푼다. Ex) d:\wildfly 4. Eclipse에 JBoss Tools 4.3.0.Final 플러그인을 설치한다. Help > Install New Software... http://download.jboss.org/jbosstools/mars/stable/updates/  주소를 추가한 후 다음 소프트웨어를 설치한다. JBoss Applicastion Server Adaper JBoss Maven Int...