-
ubuntu (14.04) 에서 php 업데이트 하기프로그래밍/Etc 2018. 12. 9. 15:05728x90반응형
도쿠위키를 설치하려다가 다음과 같은 에러가 나와서 설치가 중단되었다.
The installer found some problems, indicated below. You can not continue until you have fixed them.
Your PHP version 5.5.9-1ubuntu4.26 is lower than the needed 5.6.0. You need to upgrade your PHP install.
도쿠위키를 설치하기 위해서는 PHP 버전이 적어도 5.6 은 되어야 한다고 해서
중간에 아래와 같이 PHP 업데이트를 진행하였다.
PPA(Personal Package Archive) 라는 개인 패키지 아카이브를 사용해서 (블로그 참조)
업데이트를 진행하였다.
유분투에서 PHP 7.0 설치를 지원하는 PPA 를 일단 추가해보자.
# sudo add-apt-repository ppa:ondrej/php
Co-installable PHP versions: PHP 5.6, PHP 7.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php ) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provide d.
Debian oldstable and stable packages are provided as well: https://deb.sury.org/ #debian-dpa
You can get more information about the packages at https://deb.sury.org
BUGS&FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting
CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advise to add ppa:ondrej/nginx-mainline
or ppa:ondrej/nginx
PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/
WARNING: add-apt-repository is broken with non-UTF-8 locales, see
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:
# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it
# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpjth0tz09/secring.gpg' created
gpg: keyring `/tmp/tmpjth0tz09/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpjth0tz09/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
설치 중간에 apache2를 위한 PPA 주소도 가이드해서 이것도 같이 추가하였다.
sudo add-apt-repository ppa:ondrej/apache2
PPA 설치가 완료되면 이 내용을 포함할 수 있도록 로컬 패키지 캐시를 업데이트한다.
sudo apt-get update
그 후 php 7.0 을 설치한다.
# sudo apt-get install php7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
duplicity librsync1 python-lockfile
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libapache2-mod-php7.0 libpcre16-3 libpcre3 libpcre3-dev libpcre32-3
libpcrecpp0 libssl1.1 php-common php7.0-cli php7.0-common php7.0-json
php7.0-opcache php7.0-readline
Suggested packages:
php-pear
The following NEW packages will be installed:
libapache2-mod-php7.0 libpcre16-3 libpcre32-3 libssl1.1 php-common php7.0
php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-readline
The following packages will be upgraded:
libpcre3 libpcre3-dev libpcrecpp0
3 upgraded, 11 newly installed, 0 to remove and 583 not upgraded.
Need to get 6,086 kB of archives.
After this operation, 20.4 MB of additional disk space will be used.
Do you want to continue? [Y/n]
정상적으로 설치가 마무리 되었다.
mysql 을 사용할 경우 php7.0-mysql 패키지도 설치해준다.
# sudo apt-get install php7.0-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
duplicity librsync1 python-lockfile
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
php7.0-mysql
0 upgraded, 1 newly installed, 0 to remove and 583 not upgraded.
Need to get 123 kB of archives.
After this operation, 526 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu/ trusty/main php7.0-mysql amd64 7.0.33-1+ubuntu14.04.1+deb.sury.org+1 [123 kB]
Fetched 123 kB in 1s (92.4 kB/s)
Selecting previously unselected package php7.0-mysql.
(Reading database ... 202132 files and directories currently installed.)
Preparing to unpack .../php7.0-mysql_7.0.33-1+ubuntu14.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php7.0-mysql (7.0.33-1+ubuntu14.04.1+deb.sury.org+1) ...
Processing triggers for libapache2-mod-php7.0 (7.0.33-1+ubuntu14.04.1+deb.sury.org+1) ...
Setting up php7.0-mysql (7.0.33-1+ubuntu14.04.1+deb.sury.org+1) ...
Creating config file /etc/php/7.0/mods-available/mysqlnd.ini with new version
Creating config file /etc/php/7.0/mods-available/mysqli.ini with new version
Creating config file /etc/php/7.0/mods-available/pdo_mysql.ini with new version
Processing triggers for libapache2-mod-php7.0 (7.0.33-1+ubuntu14.04.1+deb.sury.org+1) ...
마지막으로 php --version으로 제대로 7.0으로 업데이트 된것을 확인한다.
# php --version
PHP 7.0.33-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Dec 7 2018 09:26:06) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
참고 : https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-ubuntu-14-04
728x90반응형'프로그래밍 > Etc' 카테고리의 다른 글
ssh 작업 백그라운드로 돌리기 (0) 2019.02.03 리눅스에 도쿠 위키 설치하기 (0) 2018.12.13 javascript json 객체에 키와 값 추가 방법 (0) 2018.11.09 jqeury로 json 정렬하기 (0) 2018.10.31 cafe24 네임서버 변경하기 (0) 2017.05.04