JAWS DAYS 2018!!!!!!!!!
https://jawsdays2018.jaws-ug.jp/
みなさん行きましたか!?
自分は当日安定のメンドクサにやられ「北斗が如く」をやっていました?
サーバレスの話が多かったとか。懇親会はコスプレしてる人とか多くてラフな人が多かったそうです。
友人がレポート書いてます!!
https://blog.lorentzca.me/jaws-days-2018/
さてさて!
まったく話は変わって
しばらくこのブログはリプレイスしてから、
PHPのバージョンアップが疎かだったので7.0から7.2にアップグレードしてみました。
■Environment
・Wordpress 4.9.4
・PHP7.0
・H2O 2.2.4
■Upgrading PHP 7.0 to PHP 7.2
・php version
1 2 3 4 5 |
$ php -v PHP 7.0.25-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.25-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies |
・install python-software-properties
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
$ sudo aptitude install python-software-properties The following NEW packages will be installed: python-pycurl{a} python-software-properties 0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 64.0 kB of archives. After unpacking 299 kB will be used. Do you want to continue? [Y/n/?] Y Get: 1 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 python-pycurl amd64 7.43.0-1ubuntu1 [43.3 kB] Get: 2 http://jp.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-software-properties all 0.96.20.7 [20.7 kB] Fetched 64.0 kB in 0s (1,274 kB/s) Selecting previously unselected package python-pycurl. (Reading database ... 125323 files and directories currently installed.) Preparing to unpack .../python-pycurl_7.43.0-1ubuntu1_amd64.deb ... Unpacking python-pycurl (7.43.0-1ubuntu1) ... Selecting previously unselected package python-software-properties. Preparing to unpack .../python-software-properties_0.96.20.7_all.deb ... Unpacking python-software-properties (0.96.20.7) ... Setting up python-pycurl (7.43.0-1ubuntu1) ... Setting up python-software-properties (0.96.20.7) ... |
・add repository ppa:ondrej/php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
$ 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 provided. 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 gpg: keyring `/tmp/tmp_5_l_rt8/secring.gpg' created gpg: keyring `/tmp/tmp_5_l_rt8/pubring.gpg' created gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com gpg: /tmp/tmp_5_l_rt8/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 |
・aptitude update
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ sudo aptitude update Hit:1 http://jp.archive.ubuntu.com/ubuntu xenial InRelease Get:2 http://jp.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB] Get:3 http://jp.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB] Hit:4 http://apt.mackerel.io/debian mackerel InRelease Ign:5 https://apt.datadoghq.com stable InRelease Hit:6 https://apt.datadoghq.com stable Release Hit:8 http://security.ubuntu.com/ubuntu xenial-security InRelease Ign:9 http://dl.bintray.com/tatsushid/h2o-deb xenial-backports InRelease Get:10 http://dl.bintray.com/tatsushid/h2o-deb xenial-backports Release [1,860 B] Hit:12 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease Fetched 206 kB in 1s (133 kB/s) Reading package lists... Done W: http://apt.mackerel.io/debian/dists/mackerel/InRelease: Signature by key 2748FD61027D357542F8394DF92F673FC2B48821 uses weak digest algorithm (SHA1) |
・purge php7.0-fpm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
$ sudo aptitude purge php7.0-fpm Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: linux-headers-4.4.0-101 linux-headers-4.4.0-101-generic linux-headers-4.4.0-103 linux-headers-4.4.0-103-generic linux-headers-4.4.0-104 linux-headers-4.4.0-104-generic linux-headers-4.4.0-109 linux-headers-4.4.0-109-generic linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-headers-4.4.0-98 linux-headers-4.4.0-98-generic linux-image-4.4.0-101-generic linux-image-4.4.0-103-generic linux-image-4.4.0-104-generic linux-image-4.4.0-109-generic linux-image-4.4.0-109-lowlatency linux-image-4.4.0-97-generic linux-image-4.4.0-98-generic linux-image-extra-4.4.0-101-generic linux-image-extra-4.4.0-103-generic linux-image-extra-4.4.0-104-generic linux-image-extra-4.4.0-109-generic linux-image-extra-4.4.0-97-generic linux-image-extra-4.4.0-98-generic Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: php7.0-fpm* 0 upgraded, 0 newly installed, 1 to remove and 31 not upgraded. After this operation, 4,511 kB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 325099 files and directories currently installed.) Removing php7.0-fpm (7.0.25-0ubuntu0.16.04.1) ... Purging configuration files for php7.0-fpm (7.0.25-0ubuntu0.16.04.1) ... dpkg: warning: while removing php7.0-fpm, directory '/etc/php/7.0/fpm/conf.d' not empty so not removed Processing triggers for man-db (2.7.5-1) ... |
・autoremove
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
$ sudo aptitude --purge autoremove Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: linux-headers-4.4.0-101* linux-headers-4.4.0-101-generic* linux-headers-4.4.0-103* linux-headers-4.4.0-103-generic* linux-headers-4.4.0-104* linux-headers-4.4.0-104-generic* linux-headers-4.4.0-109* linux-headers-4.4.0-109-generic* linux-headers-4.4.0-97* linux-headers-4.4.0-97-generic* linux-headers-4.4.0-98* linux-headers-4.4.0-98-generic* linux-image-4.4.0-101-generic* linux-image-4.4.0-103-generic* linux-image-4.4.0-104-generic* linux-image-4.4.0-109-generic* linux-image-4.4.0-109-lowlatency* linux-image-4.4.0-97-generic* linux-image-4.4.0-98-generic* linux-image-extra-4.4.0-101-generic* linux-image-extra-4.4.0-103-generic* linux-image-extra-4.4.0-104-generic* linux-image-extra-4.4.0-109-generic* linux-image-extra-4.4.0-97-generic* linux-image-extra-4.4.0-98-generic* 0 upgraded, 0 newly installed, 25 to remove and 31 not upgraded. After this operation, 2,007 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 325074 files and directories currently installed.) Removing linux-headers-4.4.0-101-generic (4.4.0-101.124) ... ~省略~ |
・install php7.2-fpm php7.2-mysql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$ sudo aptitude install php7.2-fpm php7.2-mysql Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libargon2-0 libpcre3 libsodium23 libssl1.1 php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline Suggested packages: php-pear The following NEW packages will be installed: libargon2-0 libsodium23 libssl1.1 php7.2-cli php7.2-common php7.2-fpm php7.2-json php7.2-opcache php7.2-readline The following packages will be upgraded: libpcre3 1 upgraded, 9 newly installed, 0 to remove and 30 not upgraded. Need to get 5,603 kB of archives. After this operation, 20.9 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 libpcre3 amd64 2:8.41-4+ubuntu16.04.1+deb.sury.org+1 [235 kB] Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 libssl1.1 amd64 1.1.0g-2.1+ubuntu16.04.1+deb.sury.org+1 [1,334 kB] Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 libargon2-0 amd64 0~20161029-1+ubuntu16.04.1+deb.sury.org+1 [19.7 kB] Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 libsodium23 amd64 1.0.16-2+ubuntu16.04.1+deb.sury.org+3 [143 kB] Fetched 5,603 kB in 47s (118 kB/s) ~省略~ |
・fix h2o.conf
1 2 3 4 |
$ grep php h2o.conf extension: .php port: /var/run/php/php7.2-fpm.sock file.index: [ 'index.html', 'index.php' ] |
■Check version package
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
$ php -v PHP 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 6 2018 11:18:25) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.3-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies $ php-fpm7.2 -v PHP 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 (fpm-fcgi) (built: Mar 6 2018 11:18:25) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.3-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies $ dpkg -l |grep php7.2 ii php7.2 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 all server-side, HTML-embedded scripting language (metapackage) ii php7.2-cgi 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (CGI binary) ii php7.2-cli 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 command-line interpreter for the PHP scripting language ii php7.2-common 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 documentation, examples and common module for PHP ii php7.2-curl 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 CURL module for PHP ii php7.2-fpm 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary) ii php7.2-gd 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 GD module for PHP ii php7.2-json 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 JSON module for PHP ii php7.2-mbstring 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 MBSTRING module for PHP ii php7.2-mysql 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 MySQL module for PHP ii php7.2-opcache 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 Zend OpCache module for PHP ii php7.2-readline 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 readline module for PHP ii php7.2-xml 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 DOM, SimpleXML, WDDX, XML, and XSL module for PHP ii php7.2-xmlrpc 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 XMLRPC-EPI module for PHP ii php7.2-zip 7.2.3-1+ubuntu16.04.1+deb.sury.org+1 amd64 Zip module for PHP |
■まとめ
あああああああ出社時間にPHPバージョンアップするんじゃなかったw
— adachin?SRE (@adachin0817) March 11, 2018
ちなみに出社前にアップグレードしてざわついて焦ったので、
必ず時間を取って行いましょう!?
参考
http://www.markhodder.com/upgrading-php-5-x-to-php-7-on-ubuntu-14-04-apache/
0件のコメント