{"id":4586,"date":"2020-10-20T23:13:56","date_gmt":"2020-10-20T14:13:56","guid":{"rendered":"https:\/\/www.xenos.jp\/~zen\/blog2\/?p=4586"},"modified":"2020-10-20T23:16:35","modified_gmt":"2020-10-20T14:16:35","slug":"post-4586","status":"publish","type":"post","link":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/2020\/10\/20\/post-4586\/","title":{"rendered":"Ubuntu\u306ePHP\u30927.2\u304b\u3089\u30017.4\u306b\u3057\u3066\u307f\u305f"},"content":{"rendered":"\n<p>Ubuntu 18.04\u306ePHP\u3092PHP7.2\u304b\u3089PHP7.4\u306b\u4e0a\u3052\u305f\u3002PHP\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u306f\u3001Wordpress\u3002\u305d\u306e\u30e1\u30e2\u3002\u3067\u3082\u3001\u9014\u4e2d\u304c\u6d88\u3048\u3066\u308b\u6c17\u304c\u3059\u308b\u3001\u3068\u3044\u3046\u304b\u6d88\u3048\u3066\u308b\u3002<\/p>\n\n\n\n<pre>\nubuntu@ip-10-0-0-122:~$ php -v\nPHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct  7 2020 15:24:25) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\n    with Zend OPcache v7.2.24-0ubuntu0.18.04.7, Copyright (c) 1999-2018, by Zend Technologies\nubuntu@ip-10-0-0-122:~$\nubuntu@ip-10-0-0-122:~$ sudo apt install software-properties-common\nReading package lists... Done\nBuilding dependency tree\nReading state information... Done\nsoftware-properties-common is already the newest version (0.96.24.32.14).\nsoftware-properties-common set to manually installed.\nThe following packages were automatically installed and are no longer required:\n  libdumbnet1 libnginx-mod-http-geoip libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail\n  libnginx-mod-stream linux-aws-5.3-headers-5.3.0-1017 linux-aws-5.3-headers-5.3.0-1019\n  linux-aws-5.3-headers-5.3.0-1023 linux-aws-5.3-headers-5.3.0-1028 linux-aws-5.3-headers-5.3.0-1030\n  linux-aws-5.3-headers-5.3.0-1032 linux-aws-5.3-headers-5.3.0-1033 linux-aws-5.3-headers-5.3.0-1034\n  linux-aws-5.3-headers-5.3.0-1035 linux-aws-headers-4.15.0-1041 linux-aws-headers-4.15.0-1043\n  linux-aws-headers-4.15.0-1044 linux-aws-headers-4.15.0-1045 linux-aws-headers-4.15.0-1047\n  linux-aws-headers-4.15.0-1048 linux-aws-headers-4.15.0-1050 linux-aws-headers-4.15.0-1052\n  linux-aws-headers-4.15.0-1054 linux-aws-headers-4.15.0-1056 linux-aws-headers-4.15.0-1057\n  linux-aws-headers-4.15.0-1058 linux-aws-headers-4.15.0-1060 linux-aws-headers-4.15.0-1063\n  linux-aws-headers-4.15.0-1065 linux-headers-5.3.0-1035-aws linux-image-5.3.0-1035-aws linux-modules-5.3.0-1035-aws\n  nginx-common nginx-core\nUse 'sudo apt autoremove' to remove them.\n0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.\nubuntu@ip-10-0-0-122:~$\nubuntu@ip-10-0-0-122:~$\nubuntu@ip-10-0-0-122:~$\nubuntu@ip-10-0-0-122:~$ sudo add-apt-repository ppa:ondrej\/php\n 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.\nDebian oldstable and stable packages are provided as well: https:\/\/deb.sury.org\/#debian-dpa\nYou can get more information about the packages at https:\/\/deb.sury.org\nIMPORTANT: The <foo>-backports is now required on older Ubuntu releases.\nBUGS&FEATURES: This PPA now has a issue tracker:\nhttps:\/\/deb.sury.org\/#bug-reporting\nCAVEATS:\n1. If you are using php-gearman, you need to add ppa:ondrej\/pkg-gearman\n2. If you are using apache2, you are advised to add ppa:ondrej\/apache2\n3. If you are using nginx, you are advised to add ppa:ondrej\/nginx-mainline\n   or ppa:ondrej\/nginx\nPLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https:\/\/donate.sury.org\/\nWARNING: add-apt-repository is broken with non-UTF-8 locales, see\nhttps:\/\/github.com\/oerdnj\/deb.sury.org\/issues\/56 for workaround:\n# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej\/php\n More info: https:\/\/launchpad.net\/~ondrej\/+archive\/ubuntu\/php\nPress [ENTER] to continue or Ctrl-c to cancel adding it.\nHit:1 http:\/\/us-east-1.ec2.archive.ubuntu.com\/ubuntu bionic InRelease\nGet:2 http:\/\/us-east-1.ec2.archive.ubuntu.com\/ubuntu bionic-updates InRelease [88.7 kB]\nGet:3 http:\/\/us-east-1.ec2.archive.ubuntu.com\/ubuntu bionic-backports InRelease [74.6 kB]\nGet:4 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu bionic InRelease [20.8 kB]\nGet:5 http:\/\/security.ubuntu.com\/ubuntu bionic-security InRelease [88.7 kB]\nGet:6 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu bionic\/main amd64 Packages [71.9 kB]\nGet:7 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu bionic\/main Translation-en [29.5 kB]\nFetched 374 kB in 1s (398 kB\/s)\nReading package lists... Done\nubuntu@ip-10-0-0-122:~$\nubuntu@ip-10-0-0-122:~$\nubuntu@ip-10-0-0-122:~$ sudo apt update\nHit:1 http:\/\/us-east-1.ec2.archive.ubuntu.com\/ubuntu bionic InRelease\nGet:2 http:\/\/us-east-1.ec2.archive.ubuntu.com\/ubuntu bionic-updates InRelease [88.7 kB]\nGet:3 http:\/\/us-east-1.ec2.archive.ubuntu.com\/ubuntu bionic-backports InRelease [74.6 kB]\nHit:4 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu bionic InRelease\nHit:5 http:\/\/security.ubuntu.com\/ubuntu bionic-security InRelease\nFetched 163 kB in 0s (399 kB\/s)\nReading package lists... Done\nBuilding dependency tree\nReading state information... Done\n20 packages can be upgraded. Run 'apt list --upgradable' to see them.\nubuntu@ip-10-0-0-122:~$\nubuntu@ip-10-0-0-122:~$ php -v\nPHP 7.4.11 (cli) (built: Oct 10 2020 19:44:50) ( NTS )\nCopyright (c) The PHP Group\nZend Engine v3.4.0, Copyright (c) Zend Technologies\n    with Zend OPcache v7.4.11, Copyright (c), by Zend Technologies\nubuntu@ip-10-0-0-122:~$\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3042\u3068\u3001Nginx\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u3067\u3001php7.2-fpm\u304b\u3089php7.4-fpm\u306b\u6307\u5b9a\u3092\u5909\u66f4\u3057\u3066\u3001Nginx\u3092\u518d\u8d77\u52d5\u3002<\/p>\n\n\n\n<p>WordPress\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3089\u3001php7.4-mysql\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u3068\u8a00\u308f\u308c\u3001\u4f7f\u3048\u305a\u3002apt\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n\n\n\n<pre>sudo apt install php7.4-mysql<\/pre>\n\n\n\n<p>\u305d\u306e\u3042\u3068\u3001Wordpress\u306e\u30d8\u30eb\u30b9\u30c1\u30a7\u30c3\u30af\u3092\u78ba\u8a8d\u3002gd\u3082\u306a\u3044\u3068\u3044\u3046\u306e\u3067\u3001apt\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n\n\n\n<pre>sudo apt install php7.4-gd<\/pre>\n\n\n\n<p>\u3053\u308c\u3067\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306f\u7d42\u308f\u308a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04\u306ePHP\u3092PHP7.2\u304b\u3089PHP7.4\u306b\u4e0a\u3052\u305f\u3002PHP\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u306f\u3001Wordpress\u3002\u305d\u306e\u30e1\u30e2\u3002\u3067\u3082\u3001\u9014\u4e2d\u304c\u6d88\u3048\u3066\u308b\u6c17\u304c\u3059\u308b\u3001\u3068\u3044\u3046\u304b\u6d88\u3048\u3066\u308b\u3002 ubuntu@ip-10-0-0-122:~ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[48,110],"class_list":["post-4586","post","type-post","status-publish","format-standard","hentry","category-tech-memo","tag-php","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/4586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/comments?post=4586"}],"version-history":[{"count":3,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/4586\/revisions"}],"predecessor-version":[{"id":4589,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/4586\/revisions\/4589"}],"wp:attachment":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/media?parent=4586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/categories?post=4586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/tags?post=4586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}