PHP 7.3으로 업그레이드

- 모든 명령은 root 권한으로 실행

* PHP 7.3 설치

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

- 패키지 확인
dpkg -l | grep php | tee packages.txt

- PHP 7.3 core 설치
sudo apt-get install php7.3 -y

- PHP 7.3 extensions 설치
sudo apt-get install php7.3-bcmath php7.3-bz2 php7.3-cgi php7.3-cli php7.3-common php7.3-curl php7.3-dba php7.3-dev php7.3-enchant php7.3-fpm php7.3-gd php7.3-gmp php7.3-imap php7.3-interbase php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-odbc php7.3-opcache php7.3-pgsql php7.3-phpdbg php7.3-pspell php7.3-readline  php7.3-recode php7.3-snmp php7.3-soap php7.3-sqlite3 php7.3-sybase php7.3-tidy php7.3-xml php7.3-xmlrpc php7.3-zip  php7.3-xsl  -y

- php7.3-fpm 설치
sudo apt install php7.3-fpm

* 설정 수정

date.timezone = Asia/Seoul





* nginx 설정

sudo nano /etc/nginx/sites-enabled/default

server {
	root 경로;
	server_name _;
	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ /index.php?$query_string;

	location ~ \.php$ {
                try_files $uri /index.php =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;



* php 7.3 재시작
sudo systemctl restart nginx.service php7.3-fpm.service

* 이전 버전 지우기
apt purge php7.2 php7.2-common



'Code > PHP' 카테고리의 다른 글

[PHP] String Complex (curly) syntax  (0) 2019.04.05
[PHP] 시간 사용법  (0) 2019.04.01
PHP 7.3으로 업그레이드  (0) 2019.03.28
라라벨 에러 해결 방법, preg_match() 에러  (0) 2019.02.23
[php] xDebug 사용법  (0) 2019.02.16
[php] Thread Safe, Non Thread Safe 차이  (0) 2019.02.15
Posted by codens codens

댓글을 달아 주세요