기본 콘텐츠로 건너뛰기

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 설치

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...

모니터링 :: Grafana와 Prometheus 설치하기

Raspberry Pi 3 B+에서 Grafana와 Prometheus 설치하기 Grafana는 오픈소스 기반의 강력한 대시보드 플랫폼이다. 서버나 임베디드 장비의 운영상태 등을 Prometheus, ElasticSearch와 같은 data source를 플러그인 방식으로 연결해서 다양한 그래픽 요소로 나타낸다. 여기서는 대표적인 오픈소스 모니터링 솔루션인 Prometheus를 이용하여 요즘 메이커들 사이에 사물인터넷의 주요 디바이스로 자리매김하고 있는 라즈베리 파이의 운영상태를 모니터링 해보기로 하겠다. [그림.1] 라즈베리 파이 3 B+ [그림.2] 운영 중인 라즈베리 파이 3 B+ 라즈베리 파이는 영국의 라즈베리 파이 재단에서 학교와 개발도상국에서의 기초 컴퓨터 과학 교육 증진을 목표로 제작한 초소형 PC이다. 메인보드에 내장된 GPIO핀을 이용하여 다양한 센서모듈을 조합하여 메이커들에게는 사물인터넷의 핵심 기기로 각광받고 있다. 서버나 사물인터넷 허브와 같이 중단없이 장시간 운영되는 장비의 경우 안정적인 운영을 위해 실시간 서비스 모니터링이 필수적인데, Prometheus를 이용하면 다양한 정보를 수집하여 로그를 저장하고 이를 Grafana와 연동하여 세련된 그래픽 환경으로 운영이 가능하다. 게다가 오픈소스로 제공되기 때문에 설치와 운영 등 기술 비용(!)을 제외하면 소프트웨어 라이선스 비용은 무료이다. (제발, 소프트웨어 라이선스가 무료라고 모든게 공짜라는 생각은 버리자!) [그림.3] Prometheus Architecture Prometheus는 그림과 같이 Prometheus 서버가 외부의 export node들로부터 metric을 pulling 방식으로 수집하고, 이를 Grafaana 등을 이용해 시각화한다. 구조는 좀 복잡해 보이지만 이 글에서 구현해 볼 모니터링 툴을 간단히 설명하면, 1. node exporter - 모니터링할 기기의 메트릭(정보)을 제공 2. prometheus - 노드들로부...