{"id":1218,"date":"2016-07-11T19:33:37","date_gmt":"2016-07-11T10:33:37","guid":{"rendered":"http:\/\/lovelinux.mydns.jp\/?p=1218"},"modified":"2016-07-11T19:33:37","modified_gmt":"2016-07-11T10:33:37","slug":"linux-mint-18-%e3%81%ab-nginx-mysql-php-phpmyadmin%e7%92%b0%e5%a2%83%e3%82%92%e6%95%b4%e3%81%88%e3%82%8b","status":"publish","type":"post","link":"https:\/\/lovelinux.mydns.jp\/?p=1218","title":{"rendered":"Linux Mint 18 \u306b nginx mysql php phpmyadmin\u74b0\u5883\u3092\u6574\u3048\u308b"},"content":{"rendered":"<p>Mint 18\u306bnginx mysql php phpmyadmin\u306e\u74b0\u5883\u3092\u6574\u3048\u307e\u3059\u3002<br \/>\nphp\u304c7.0\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u82e5\u5e72\u82e6\u52b4\u3057\u307e\u3057\u305f\u306e\u3067\u305d\u306e\u6642\u306e\u30e1\u30e2\u3067\u3059\u3002<\/p>\n<h3>nginx\u3001mysql\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>[bash]<br \/>\n$ sudo apt-get install nginx mysql-server<br \/>\n[\/bash]<\/p>\n<h3>nginx\u306e\u8d77\u52d5\u78ba\u8a8d<\/h3>\n<p>[bash]<br \/>\n$ sudo systemctl start nginx.service<br \/>\n[\/bash]<\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u30fc\u3067 http:\/\/localhost\u3000\u3068\u3057\u3066nginx\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>php\u3001php-fpm\u306a\u3069\u306a\u3069\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>[bash]<br \/>\n$ sudo apt-get install php php-fpm php7.0-mysql php-gettext php-common php-mbstring php7.0-mbstring<br \/>\n[\/bash]<\/p>\n<h3>php.ini\u8abf\u6574<\/h3>\n<p>[bash]<br \/>\n$ sudo nano \/etc\/php\/7.0\/fpm\/php.ini<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u306e\u90e8\u5206\u3092\u8abf\u6574\u3057\u307e\u3059\u3002<br \/>\n[diff]<br \/>\n+ cgi.fix_pathinfo=0<br \/>\n[\/diff]<\/p>\n<h3>nginx\u3000php\u9023\u643a<\/h3>\n<h4>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u8abf\u6574<\/h4>\n<p>[bash]<br \/>\n$ sudo nano \/etc\/nginx\/sites-available\/default<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<p>[bash]<br \/>\n    location ~ \\.php$ {<br \/>\n        try_files $uri =404;<br \/>\n        fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock;<br \/>\n        fastcgi_index index.php;<br \/>\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br \/>\n        include fastcgi_params;<br \/>\n    }<br \/>\n[\/bash]<\/p>\n<h4>\u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210<\/h4>\n<p>[bash]<br \/>\n$ sudo nano \/var\/www\/html\/test.php<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u306e\uff11\u884c\u3092\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n[bash]<br \/>\n<?php phpinfo(); ?><br \/>\n[\/bash]<\/p>\n<h4>nginx\u518d\u8d77\u52d5<\/h4>\n<p>[bash]<br \/>\n$ sudo systemctl restart nginx.service<br \/>\n[\/bash]<\/p>\n<h4>\u30d6\u30e9\u30a6\u30b6\u30fc\u3067\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>http:\/\/localhost\/test.php \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u304c\u3055\u308c\u308c\u3070OK<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest-1024x635.png\" alt=\"phptest\" width=\"620\" height=\"384\" class=\"alignnone size-large wp-image-1208\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest-1024x635.png 1024w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest-300x186.png 300w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest.png 1062w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<h3>phpmyadmin\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p><a href=\"https:\/\/www.phpmyadmin.net\/\">https:\/\/www.phpmyadmin.net\/<\/a>\u3088\u308a\u6700\u65b0\u7248\u3092\u5165\u624b\u3002<\/p>\n<h4>\u89e3\u51cd\u3057\u3066 \/usr\/share\u3078\u30b3\u30d4\u30fc<\/h4>\n<p>[bash]<br \/>\n$ unzip phpMyAdmin-4.6.3-all-languages.zip<br \/>\n$ mv phpMyAdmin-4.6.3-all-languages phpmyadmin<br \/>\n$ sudo mv phpmyadmin\/ \/usr\/share\/<br \/>\n[\/bash]<\/p>\n<h4>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u8abf\u6574<\/h4>\n<p>[bash]<br \/>\n$ sudo nano \/etc\/nginx\/sites-available\/default<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0b\u3092\u8ffd\u8a18<br \/>\n[bash]<br \/>\n    location \/phpmyadmin {<br \/>\n        root \/usr\/share;<br \/>\n        index index.php;<\/p>\n<p>        location ~ ^\/phpmyadmin.+\\.php$ {<br \/>\n            fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock;<br \/>\n            fastcgi_index index.php;<br \/>\n            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br \/>\n            include fastcgi_params;<br \/>\n        }<\/p>\n<p>    }<br \/>\n[\/bash]<\/p>\n<h4>nginx\u518d\u8d77\u52d5<\/h4>\n<p>[bash]<br \/>\n$ sudo systemctl stop nginx.service<br \/>\n$ sudo systemctl start nginx.service<br \/>\n[\/bash]<\/p>\n<h4>\u52d5\u4f5c\u78ba\u8a8d<\/h4>\n<p>http:\/\/localhost\/phpmyadmin \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308c\u3070\u6210\u529f<br \/>\n<a href=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest2.png\" alt=\"phptest2\" width=\"665\" height=\"596\" class=\"alignnone size-full wp-image-1209\" srcset=\"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest2.png 665w, https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2016\/07\/phptest2-300x268.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mint 18\u306bnginx mysql php phpmyadmin\u306e\u74b0\u5883\u3092\u6574\u3048\u307e\u3059\u3002 php\u304c7.0\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u82e5\u5e72\u82e6\u52b4\u3057\u307e\u3057\u305f\u306e\u3067\u305d\u306e\u6642\u306e\u30e1\u30e2\u3067\u3059\u3002 nginx\u3001mysql\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb [bash] $ sudo apt-get install nginx mysql-server [\/bash] nginx\u306e\u8d77\u52d5\u78ba\u8a8d [bash] $ sudo systemctl start nginx.service [\/bash] \u30d6\u30e9\u30a6\u30b6\u30fc\u3067 http:\/\/localhost\u3000\u3068\u3057\u3066nginx\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 php\u3001php-fpm\u306a\u3069\u306a\u3069\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb [bash] $ sudo apt-get install php php-fpm php7.0-mysql php-gettext php-common php-mbstring php7.0-mbstring [\/bash] php.ini\u8abf\u6574 [bash] $ sudo nano \/etc\/php\/7.0\/fpm\/php.ini [\/bash] \u4ee5\u4e0b\u306e\u90e8\u5206\u3092\u8abf\u6574\u3057\u307e\u3059\u3002 [diff] + cgi.fix_pathinfo=0 [\/diff] nginx\u3000php\u9023\u643a \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u8abf\u6574 [bash] $ sudo nano \/etc\/nginx\/sites-available\/default [\/bash] \u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002 [bash] location ~ \\.php$ { try_files $uri =404; fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } [\/bash] \u30c6\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210 [bash] $ sudo nano \/var\/www\/html\/test.php [\/bash] \u4ee5\u4e0b\u306e\uff11\u884c\u3092\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002 [bash] [\/bash] nginx\u518d\u8d77\u52d5 [bash] $ sudo systemctl restart nginx.service [\/bash] \u30d6\u30e9\u30a6\u30b6\u30fc\u3067\u52d5\u4f5c\u78ba\u8a8d http:\/\/localhost\/test.php \u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u304c\u3055\u308c\u308c\u3070OK phpmyadmin\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb https:\/\/www.phpmyadmin.net\/\u3088\u308a\u6700\u65b0\u7248\u3092\u5165\u624b\u3002 \u89e3\u51cd\u3057\u3066 \/usr\/share\u3078\u30b3\u30d4\u30fc [bash] $ unzip phpMyAdmin-4.6.3-all-languages.zip $ mv phpMyAdmin-4.6.3-all-languages phpmyadmin $ sudo mv phpmyadmin\/ \/usr\/share\/ [\/bash] \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u8abf\u6574 [bash] $ sudo nano \/etc\/nginx\/sites-available\/default [\/bash] \u4ee5\u4e0b\u3092\u8ffd\u8a18 [bash] location \/phpmyadmin { root \/usr\/share; index index.php; location ~ ^\/phpmyadmin.+\\.php$ { fastcgi_pass unix:\/var\/run\/php\/php7.0-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } [\/bash] nginx\u518d\u8d77\u52d5 [bash] $ sudo systemctl stop nginx.service $ sudo systemctl start nginx.service [\/bash] \u52d5\u4f5c\u78ba\u8a8d http:\/\/localhost\/phpmyadmin \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308c\u3070\u6210\u529f<\/p>\n","protected":false},"author":1,"featured_media":1220,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[4],"tags":[68,66,13,15,52],"class_list":{"0":"post-1218","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-4","8":"tag-mint-18","9":"tag-mysql","10":"tag-nginx","11":"tag-php","12":"tag-phpmyadmin"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1218"}],"version-history":[{"count":1,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1218\/revisions"}],"predecessor-version":[{"id":1219,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/1218\/revisions\/1219"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/media\/1220"}],"wp:attachment":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}