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.
댓글
댓글 쓰기