{"id":2511,"date":"2022-01-04T15:18:40","date_gmt":"2022-01-04T06:18:40","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=2511"},"modified":"2022-03-13T11:37:55","modified_gmt":"2022-03-13T02:37:55","slug":"apache-php%e3%83%a2%e3%82%b8%e3%83%a5%e3%83%bc%e3%83%ab%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=2511","title":{"rendered":"Apache PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<p>WEB\u30b5\u30fc\u30d0\u3067PHP\u3092\u52d5\u4f5c\u3055\u305b\u308b\u5834\u5408\u3001Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3060\u3051\u3067\u306f\u52d5\u304d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>PHP\u3092web\u30b5\u30fc\u30d0\u3067\u52d5\u304b\u3059\u306b\u306f\u5927\u304d\u304f\u30013\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fbApache\u306ePHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3002<br>\u30fbCGI\u3068\u3057\u3066PHP\u3092\u52d5\u304b\u3059\u3002<br>\u30fbphp-fpm\u3092\u4f7f\u7528\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f Apache\u306ePHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3001PHP\u3092\u52d5\u4f5c\u3055\u305b\u308b\u3053\u3068\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u8aac\u660e<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">Apache\u306ePHP\u30e2\u30b8\u30e5\u30fc\u30eb<\/h2>\n\n\n\n<p>Apache\u306f\u5fc5\u8981\u306a\u6a5f\u80fd\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u8a00\u3046\u5358\u4f4d\u3067\u8aad\u307f\u8fbc\u3093\u3067\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u4e2d\u3067PHP\u3092\u5b9f\u884c\u3059\u308b\u70ba\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<br>Apache\u306f\u3001\u3053\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066PHP\u3092\u52d5\u304b\u3059\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>Apache\u304c\u8aad\u307f\u8fbc\u3080\u30e2\u30b8\u30e5\u30fc\u30eb\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"title_box\">\n<span class=\"box-title\">\u53c2\u8003<\/span><p><a href=\"https:\/\/dennie.tokyo\/it\/?p=2495\" rel=\"noopener\" target=\"_blank\">Apache \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3088\u307f\u3053\u307f\u306b\u3064\u3044\u3066<\/a><\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<h2 class=\"wp-block-heading\">PHP\u306e\u5b9f\u884c\u30d7\u30ed\u30bb\u30b9<\/h2>\n\n\n\n<p>PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306b\u3001\u610f\u8b58\u3059\u308b\u3053\u3068\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<br>Apache\u306ePHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3067PHP\u3092\u52d5\u4f5c\u3055\u305b\u308b\u5834\u5408\u3001PHP\u306e\u52d5\u4f5c\u306fApache\u306e\u30d7\u30ed\u30bb\u30b9\u3067\u5b9f\u884c\u3055\u308c\u308b\u4e8b\u3092\u610f\u8b58\u3057\u3066\u4e0b\u3055\u3044\u3002\u7c21\u5358\u306b\u8a00\u3046\u3068PHP\u81ea\u8eab\u304cPHP\u3092\u52d5\u304b\u3059\u306e\u3067\u306f\u306a\u304f\u3001Apache\u304cPHP\u3092\u52d5\u304b\u3059\u3068\u8a00\u3046\u4e8b\u3067\u3059\u3002\u3053\u308c\u306fApache\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066PHP\u3092\u52d5\u4f5c\u3055\u305b\u308b\u70ba\u3001Apache\u304cPHP\u3092\u52d5\u304b\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br>Apache\u306e\u30d7\u30ed\u30bb\u30b9\u3067\u52d5\u4f5c\u3059\u308b\u3068\u8a00\u3046\u3053\u3068\u306f\u3001WEB\u30b5\u30a4\u30c8\u3084WEB\u30b5\u30fc\u30d3\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u304c\u591a\u3051\u308c\u3070\u591a\u3044\u307b\u3069WEB\u30b5\u30fc\u30d0(Apache)\u306b\u8ca0\u8377\u304c\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">Apache PHP \u306e\u5b9f\u884c<\/h1>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u5b9f\u969b\u306bApache\u306bPHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066PHP\u3092\u52d5\u304b\u3057\u3066\u307f\u307e\u3059\u3002\u306a\u304a\u3001PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u3001\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<div class=\"title_box\">\n<span class=\"box-title\">\u53c2\u8003<\/span><p><a href=\"https:\/\/dennie.tokyo\/it\/?p=2305\" rel=\"noopener\" target=\"_blank\">\u3010Amazon linux\u3011 PHP8 \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u4e8b\u306e\u78ba\u8a8d<\/h3>\n\n\n\n<p>PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u4e8b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br>&#8220;php_module&#8221; \u304c\u306a\u3051\u308c\u3070\u3001PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u306a\u3044\u3068\u8a00\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fb\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>grep -r php \/etc\/httpd\/conf.modules.d<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fb\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>yum -y install mod_php<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u78ba\u8a8d<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u4e8b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30fb\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>grep -r php \/etc\/httpd\/conf.modules.d<\/code><\/pre><\/div>\n\n\n\n<p>\u30fb\u7d50\u679c<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\/etc\/httpd\/conf.modules.d\/15-php.conf:# Cannot load multiple php modules\n\/etc\/httpd\/conf.modules.d\/15-php.conf:&lt;IfModule !mod_php5.c&gt;\n\/etc\/httpd\/conf.modules.d\/15-php.conf:    &lt;IfModule !mod_php7.c&gt;\n\/etc\/httpd\/conf.modules.d\/15-php.conf:            LoadModule php_module modules\/libphp.so\n\/etc\/httpd\/conf.modules.d\/15-php.conf:&lt;IfModule !mod_php5.c&gt;\n\/etc\/httpd\/conf.modules.d\/15-php.conf:  &lt;IfModule !mod_php7.c&gt;\n\/etc\/httpd\/conf.modules.d\/15-php.conf:      # PHP under apache, use the php-fpm package instead.\n\/etc\/httpd\/conf.modules.d\/15-php.conf:      LoadModule php_module modules\/libphp-zts.so<\/code><\/pre><\/div>\n\n\n\n<p>15-php.conf \u3068\u8a00\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u3066\u3001\u3069\u3046\u3084\u3089\u305d\u3053\u306bPHP\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u25a0 \u88dc\u8db3<br>\u304a\u305d\u3089\u304f\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u7d10\u3065\u304fPHP\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002\u306a\u306e\u3067\u3001\u4f7f\u7528\u3057\u305f\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5f8c\u306b\u5b9f\u884c\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u78ba\u8a8d<\/h3>\n\n\n\n<p>PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u308b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u30fb\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>cat \/etc\/httpd\/conf.modules.d\/15-php.conf<\/code><\/pre><\/div>\n\n\n\n<p>\u30fb\u5185\u5bb9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>#\n# PHP is an HTML-embedded scripting language which attempts to make it\n# easy for developers to write dynamically generated webpages.\n#\n\n# Cannot load multiple php modules\n&lt;IfModule !mod_php5.c&gt;\n    &lt;IfModule !mod_php7.c&gt;\n        &lt;IfModule prefork.c&gt;\n            LoadModule php_module modules\/libphp.so\n        &lt;\/IfModule&gt;\n    &lt;\/IfModule&gt;\n&lt;\/IfModule&gt;\n\n&lt;IfModule !mod_php5.c&gt;\n  &lt;IfModule !mod_php7.c&gt;\n    &lt;IfModule !prefork.c&gt;\n      # The ZTS module is not the supported method of executing\n      # PHP under apache, use the php-fpm package instead.\n      #\n      # https:\/\/wiki.apache.org\/httpd\/PHP-FPM\n      LoadModule php_module modules\/libphp-zts.so\n    &lt;\/IfModule&gt;\n  &lt;\/IfModule&gt;\n&lt;\/IfModule&gt;<\/code><\/pre><\/div>\n\n\n\n<p>modules\/libphp.so \u304cPHP\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3088\u3046\u3067\u3001LoadModule\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306b\u3088\u308a\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u8aad\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u4e8b\u304c\u5206\u304b\u308a\u307e\u3059\u3002libphp-zts.so \u306fPHP FPM \u7528\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u3088\u3046\u3067\u3059\u3002PHP FPM\u306b\u3064\u3044\u3066\u306f\u8aac\u660e\u3092\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u5b9f\u969b\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30fb\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>ls -al \/etc\/httpd\/modules\/<\/code><\/pre><\/div>\n\n\n\n<p>\u30fb\u7d50\u679c(\u4e00\u90e8\u629c\u7c8b)<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>-rwxr-xr-x 1 root root 5172520 Jul 7 17:41 libphp-zts.so\n-rwxr-xr-x 1 root root 5172536 Jul 7 17:41 libphp.so<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Apache\u306e\u8a2d\u5b9a\u8aad\u307f\u8fbc\u307f<\/h2>\n\n\n\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u305f\u3060\u3051\u3067\u306fApache\u306f\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u3093\u3067\u304f\u308c\u307e\u305b\u3093\u3002Apache\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u5909\u66f4\u3057\u305f\u8a2d\u5b9a\u3092\u8aad\u307f\u8fbc\u3093\u3067\u304f\u308c\u307e\u3059\u3002<br>\u3086\u3048\u306b\u3001Apache\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>systemctl restart httpd<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u52d5\u4f5c\u78ba\u8a8d\u7528\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<\/h3>\n\n\n\n<p>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30eb\u30fc\u30c8 &#8220;\/var\/www\/html&#8221; \u3078 index.php \u3068\u8a00\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002 <\/p>\n\n\n\n<p>\u30fb\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>vi \/var\/www\/html\/index.php<\/code><\/pre><\/div>\n\n\n\n<p>\u30fb\u5185\u5bb9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>&lt;?php\nphpinfo();<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u78ba\u8a8d<\/h3>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u3078 http:\/\/localhost \u3092\u5165\u529b\u3057\u3066\u4e0b\u3055\u3044\u3002 php\u306e\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h1>\n\n\n\n<p>\u4eca\u56de\u306fPHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092yum\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u305f\u304c\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066PHP\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WEB\u30b5\u30fc\u30d0\u3067PHP\u3092\u52d5\u4f5c\u3055\u305b\u308b\u5834\u5408\u3001Apache\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057PHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3060\u3051\u3067\u306f\u52d5\u304d\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"author":1,"featured_media":5,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-2511","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/2511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2511"}],"version-history":[{"count":36,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/2511\/revisions"}],"predecessor-version":[{"id":3118,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/2511\/revisions\/3118"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/5"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}