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
//======================
* 설정 수정
/etc/php/7.3/fpm/php.ini
/etc/php/7.3/cli/php.ini
date.timezone = Asia/Seoul
upload_max_filesize
post_max_size
//=================
* 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
//=============
//참고
https://happist.com/564130/%EC%9B%8C%EB%93%9C%ED%94%84%EB%A0%88%EC%8A%A4-%EC%B5%9C%EC%A0%81%ED%99%94-%ED%95%9C%EC%B8%B5-%EB%B9%A8%EB%9D%BC%EC%A7%84-%EC%B5%9C%EC%8B%A0-php-7-3-%EC%84%A4%EC%B9%98-%EB%B0%A9%EB%B2%95/
https://ayesh.me/Ubuntu-PHP-7.3
'Code > PHP' 카테고리의 다른 글
[PHP] String Complex (curly) syntax (0) | 2019.04.05 |
---|---|
[PHP] 시간 사용법 (0) | 2019.04.01 |
라라벨 에러 해결 방법, preg_match() 에러 (0) | 2019.02.23 |
[php] xDebug 사용법 (0) | 2019.02.16 |
[php] Thread Safe, Non Thread Safe 차이 (0) | 2019.02.15 |