php 8.1 설치 (ubuntu)

Code/PHP 2022. 8. 3. 18:54

php 8.1  (ubuntu)

https://computingforgeeks.com/how-to-install-php-on-ubuntu-linux-system/

 

sudo add-apt-repository ppa:ondrej/php
sudo apt update

sudo apt install php8.1

    - 동작 버전 변경
        - php 버전을 8.1으로 설정
sudo update-alternatives --config php


    - php 버전 확인
php -v


    - 작동중인 서비스 확인
systemctl status php*-fpm.service
        - 서비스가 있다면 중지시키고, 중지가 정상적으로 안되면 삭제후 재부팅
sudo systemctl stop nginx php7.3-fpm  php8.0-fpm  php8.1-fpm

    - 모듈 설치
sudo apt install php8.1-cli php8.1-fpm php8.1-common  php8.1-redis php8.1-xml  php8.1-zip php8.1-mbstring  php8.1-bz2 php8.1-curl php8.1-gd  php8.1-gmp php8.1-intl php8.1-opcache  php8.1-mysql php8.1-bcmath  php8.1-tidy  php8.1-xsl

 

    - 주의 : sudo apt install php8.1-{cli,fpm,common, ..... } 식으로 설치하지 않는다. - 나중에 비정상 동작한 경험 있음


    - common 에 속하는 모듈  : calendar, ctype, exif, ffi, fileinfo, ftp, gettext, iconv, pdo, phar, posix, shmop, sockets, sysvmsg, sysvsem, sysvshm, tokenizer

https://packages.ubuntu.com/kinetic/arm64/php8.1-common/filelist

 


//-------------------------------------
    - 설정 수정
sudo nano /etc/php/8.1/fpm/php.ini
sudo nano /etc/php/8.1/cli/php.ini - extension은 수정하지 않는다.

//
post_max_size = 50M
extension_dir = "ext"  ; 윈도우
upload_max_filesize = 50M

date.timezone = Asia/Seoul

opcache.enable=1
opcache.jit_buffer_size=100M
opcache.jit=1255

    - extension 주석처리 수정
bz2 , curl, fileinfo, gd, gettext, gmp, intl, mbstring, exif, mysqli, openssl, pdo_mysql, sockets, sodium, opcache



//-------------------------------------
    - nginx 설정 수정
sudo nano /etc/nginx/sites-enabled/default

    - 재시작
sudo systemctl stop nginx php7.3-fpm  php8.0-fpm  php8.1-fpm
sudo systemctl restart nginx php8.1-fpm

 

반응형
Posted by codens