{"id":586,"date":"2022-12-28T18:27:09","date_gmt":"2022-12-28T09:27:09","guid":{"rendered":"https:\/\/www.ambulo.tv\/blog\/?p=586"},"modified":"2024-06-02T13:54:43","modified_gmt":"2024-06-02T04:54:43","slug":"centos%e3%81%aephp%e3%82%925-4%e3%81%8b%e3%82%897-4%e3%81%b8%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88","status":"publish","type":"post","link":"https:\/\/www.ambulo.tv\/blog\/centos%e3%81%aephp%e3%82%925-4%e3%81%8b%e3%82%897-4%e3%81%b8%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88\/","title":{"rendered":"PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u5927\u307e\u304b\u306a\u624b\u9806<\/h3>\n\n\n\n<p>Amazon Linux (AWS EC2) \u306e PHP \u306e 5.3 =&gt; 7.3 \u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u306b\u3064\u3044\u3066<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u73fe\u5728\u306e\u74b0\u5883\u306e\u78ba\u8a8d\u3068php.ini\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/li>\n\n\n\n<li>Apache\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/li>\n\n\n\n<li>\u73fe\u5728\u306ePHP\u306e\u524a\u9664<\/li>\n\n\n\n<li>\u65b0\u898f\u306ePHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/li>\n\n\n\n<li>Web\u30b5\u30fc\u30d0\u306e\u518d\u8d77\u52d5<\/li>\n\n\n\n<li>\u53c2\u8003\u30da\u30fc\u30b8<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u73fe\u5728\u306e\u74b0\u5883\u306e\u78ba\u8a8d\u3068php.ini\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/h3>\n\n\n\n<p>\u73fe\u5728\u306ePHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# php -v\n<\/pre><\/div>\n\n\n<p>\u73fe\u5728\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f\u306ePHP\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u78ba\u8a8d\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# yum list installed php*\n<\/pre><\/div>\n\n\n<p>\u73fe\u5728\u306ephp.ini\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# cp -a \/etc\/php.ini \/etc\/php.ini.5.4.bak\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Apache\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/h3>\n\n\n\n<p>httpd-tools\u3001httpd\u3092\u524a\u9664<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo yum remove -y httpd-tools\n$ sudo yum remove -y httpd\n<\/pre><\/div>\n\n\n<p>\u5b58\u5728\u3057\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ which httpd\n\/usr\/bin\/which: no httpd in (\/usr\/local\/bin:\/bin:\/usr\/bin:\/usr\/local\/sbin:\/usr\/sbin:\/sbin:\/opt\/aws\/bin:\/home\/ec2-user\/.local\/bin:\/home\/ec2-user\/bin)\n<\/pre><\/div>\n\n\n<p>httpd24\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo yum install -y httpd24\n$ httpd -version\nServer version: Apache\/2.4.58 (Amazon)\nServer built:   Oct 25 2023 21:17:34\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u73fe\u5728\u306ePHP\u3092\u524a\u9664<\/h3>\n\n\n\n<p>\u3059\u3079\u3066\u306ePHP\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u524a\u9664<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo yum -y remove php-*\n$ sudo yum -y remove httpd-tools\n$ sudo yum clean all\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u65b0\u898f\u306ePHP\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>Amazon Linux AMI:&nbsp;<code>amzn-main<\/code>\u3001\u304a\u3088\u3073&nbsp;<code>amzn-updates<\/code><\/p>\n\n\n\n<p>Amazon Linux AMI\u306f\u3001<code>amzn-main<\/code>\u3001\u304a\u3088\u3073&nbsp;<code>amzn-updates<\/code>\u30ea\u30dd\u30b8\u30c8\u30ea\u306bphp7.3\u307e\u3067\u3042\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo yum install php73 php73-mbstring php73-pdo php73-devel php73-mysqlnd.x86_64\n$ sudo yum install mod24_ssl.x86_64\n<\/pre><\/div>\n\n\n<p>\u78ba\u8a8d<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ yum list installed | grep php\nphp73.x86_64                         7.3.2-1.13.amzn1              @amzn-updates\nphp73-cli.x86_64                     7.3.2-1.13.amzn1              @amzn-updates\nphp73-common.x86_64                  7.3.2-1.13.amzn1              @amzn-updates\nphp73-devel.x86_64                   7.3.2-1.13.amzn1              @amzn-updates\nphp73-json.x86_64                    7.3.2-1.13.amzn1              @amzn-updates\nphp73-mbstring.x86_64                7.3.2-1.13.amzn1              @amzn-updates\nphp73-mysqlnd.x86_64                 7.3.2-1.13.amzn1              @amzn-updates\nphp73-pdo.x86_64                     7.3.2-1.13.amzn1              @amzn-updates\nphp73-process.x86_64                 7.3.2-1.13.amzn1              @amzn-updates\nphp73-xml.x86_64                     7.3.2-1.13.amzn1              @amzn-updates\n<\/pre><\/div>\n\n\n<p>PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u78ba\u8a8d<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ php -v\nPHP 7.3.30 (cli) (built: Oct  6 2021 20:34:22) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.3.30, Copyright (c) 1998-2018 Zend Technologies\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">WEB\u30b5\u30fc\u30d0\u306e\u518d\u8d77\u52d5<\/h3>\n\n\n\n<p>Apache\u306e\u518d\u8d77\u52d5<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo service httpd restart\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p>PHP7.4\u306fAmazon Linux2\u3067\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u53c2\u8003\u30da\u30fc\u30b8<\/h3>\n\n\n\n<p><a href=\"https:\/\/docs.aws.amazon.com\/ja_jp\/AWSEC2\/latest\/UserGuide\/managing-software.html\">Amazon Linux \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u7ba1\u7406<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/utano.jp\/entry\/2016\/10\/amazon-linux-apache-24-install\/\">Amazon Linux \u306b yum \u3092\u4f7f\u3063\u3066 Apache(httpd) 2.4 \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-tech wp-block-embed-tech\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"ua6eSjuCOR\"><a href=\"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/3009\">[EC2] PHP7\u3078\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5099\u5fd8\u9332<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;[EC2] PHP7\u3078\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u5099\u5fd8\u9332&#8221; &#8212; Tech\u63a7\u3048\u5e33\" src=\"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/3009\/embed#?secret=p5fgemBQs9#?secret=ua6eSjuCOR\" data-secret=\"ua6eSjuCOR\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-hatena-blog wp-block-embed-hatena-blog\"><div class=\"wp-block-embed__wrapper\">\n<iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" title=\"Amazon Linux 2\u3078PHP7.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b - \u30e2\u30d2\u30ab\u30f3\u30e1\u30e2\" src=\"https:\/\/hatenablog-parts.com\/embed?url=https%3A%2F%2Fblog.pinkumohikan.com%2Fentry%2Fhow-to-install-php74-to-amazon-linux-2#?secret=hDRRbYQZoH\" data-secret=\"hDRRbYQZoH\" scrolling=\"no\" frameborder=\"0\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>\u203b\u516c\u5f0f\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306fphp7.2\u307e\u3067<br><a href=\"https:\/\/docs.aws.amazon.com\/ja_jp\/AWSEC2\/latest\/UserGuide\/install-LAMP.html\">Amazon Linux \u3078\u306e LAMP \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u307e\u304b\u306a\u624b\u9806 Amazon Linux (AWS EC2) &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,38,36],"tags":[],"class_list":["post-586","post","type-post","status-publish","format-standard","hentry","category-amzon-linux","category-php","category-computing","article","has-background","has-excerpt","has-avatar","has-author","has-date","has-comment-count","has-category-meta","has-read-more","thumbnail-"],"_links":{"self":[{"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/posts\/586"}],"collection":[{"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/comments?post=586"}],"version-history":[{"count":16,"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/posts\/586\/revisions"}],"predecessor-version":[{"id":737,"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/posts\/586\/revisions\/737"}],"wp:attachment":[{"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/media?parent=586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/categories?post=586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ambulo.tv\/blog\/wp-json\/wp\/v2\/tags?post=586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}