{"id":4592,"date":"2020-10-22T23:01:36","date_gmt":"2020-10-22T14:01:36","guid":{"rendered":"https:\/\/www.xenos.jp\/~zen\/blog2\/?p=4592"},"modified":"2020-10-22T23:01:38","modified_gmt":"2020-10-22T14:01:38","slug":"post-4592","status":"publish","type":"post","link":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/2020\/10\/22\/post-4592\/","title":{"rendered":"PHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3057\u305f\u3089\u3001Nginx\u304c\u8d77\u52d5\u3057\u306a\u304f\u306a\u3063\u305f"},"content":{"rendered":"\n<p>Ubuntu 18.04\u3067\u3001PHP\u3092PHP7.2\u304b\u3089PHP7.4\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u305f\u3068\u3053\u308d\u3001\u4f5c\u696d\u5f8c\u306bOS\u3092\u518d\u8d77\u52d5\u3057\u305f\u3089\u3001Nginx\u304c\u8d77\u52d5\u3057\u306a\u304f\u306a\u3063\u305f\u3002\u539f\u56e0\u3092\u8abf\u3079\u3066\u5bfe\u51e6\u3057\u305f\u306e\u3067\u3001\u30e1\u30e2\u3092\u6b8b\u3059\u3002<\/p>\n\n\n\n<p>Nginx\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u3002<\/p>\n\n\n\n<pre>\nubuntu@ip-10-0-0-122:\/etc\/nginx$ sudo service nginx status\n\u25cf nginx.service - A high performance web server and a reverse proxy server\n   Loaded: loaded (\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: enabled)\n   Active: failed (Result: exit-code) since Wed 2020-10-14 22:35:23 PDT; 5s ago\n     Docs: man:nginx(8)\n  Process: 1296 ExecStartPre=\/usr\/sbin\/nginx -t -q -g daemon on; master_process on; (code=exited, status=1\/FAILURE)\nOct 14 22:35:23 ip-10-0-0-122 systemd[1]: Starting A high performance web server and a reverse proxy server...\nOct 14 22:35:23 ip-10-0-0-122 nginx[1296]: nginx: [emerg] \"try_files\" directive is duplicate in \/etc\/nginx\/sites-enabled\nOct 14 22:35:23 ip-10-0-0-122 nginx[1296]: nginx: configuration file \/etc\/nginx\/nginx.conf test failed\nOct 14 22:35:23 ip-10-0-0-122 systemd[1]: nginx.service: Control process exited, code=exited status=1\nOct 14 22:35:23 ip-10-0-0-122 systemd[1]: nginx.service: Failed with result 'exit-code'.\nOct 14 22:35:23 ip-10-0-0-122 systemd[1]: Failed to start A high performance web server and a reverse proxy server.\nubuntu@ip-10-0-0-122:\/etc\/nginx$\n<\/pre>\n\n\n\n<p>PHP7.4\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u3001Apache\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3001\u3053\u308c\u304c\u81ea\u52d5\u8d77\u52d5\u3057\u3066\u304a\u308a\u3001Nginx\u3068\u3001\u30dd\u30fc\u30c880\u306e\u4f7f\u7528\u304c\u7af6\u5408\u3057\u3066\u3001Nginx\u304c\u843d\u3061\u3066\u3044\u305f\u3002apache2\u306e\u81ea\u52d5\u8d77\u52d5\u3092\u505c\u6b62\u3059\u308b\u3002<\/p>\n\n\n\n<pre>\nsudo systemctl disable apache2\n<\/pre>\n\n\n\n<p>\u305d\u308c\u3067\u3082\u3001\u307e\u3060\u3001Nginx\u306e\u8d77\u52d5\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002\u30ed\u30b0\u3092\u898b\u308b\u3068\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u306e\u554f\u984c\u306e\u3088\u3046\u306a\u306e\u3067\u3001configtest\u3092\u5b9f\u65bd\u3057\u3001\u898b\u4e8b\u306b\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<pre>\nubuntu@ip-10-0-0-122:\/etc\/nginx\/sites-available$ sudo service nginx configtest\n * Testing nginx configuration                                                                                   [fail]\nubuntu@ip-10-0-0-122:\/etc\/nginx\/sites-available$\n<\/pre>\n\n\n\n<p>Nginx\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u306edefault\u3067\u3001php7.2-fpm\u306e\u90e8\u5206\u3092\u3001php7.4-fpm\u306esock\u306b\u66f8\u304d\u63db\u3048\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u5f8c\u3001Nginx\u306e\u8d77\u52d5\u3092\u8a66\u3059\u304c\u5931\u6557\u3002Nginx\u306e\u30b3\u30f3\u30d5\u30a3\u30b0\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3063\u3066\u3001\u30a8\u30e9\u30fc\u306b\u306a\u3063\u3066\u3044\u308b\u884c\u3092\u7279\u5b9a\u3002<\/p>\n\n\n\n<pre>\nsudo nginx -t\nnginx: [emerg] \"try_files\" directive is duplicate in \/etc\/nginx\/sites-enabled\/default:77\nnginx: configuration file \/etc\/nginx\/nginx.conf test failed\n<\/pre>\n\n\n\n<p>&#8220;try_files&#8221; \u304c\u30c0\u30d6\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u306e\u3067\u3001\u5834\u6240\u3092\u78ba\u8a8d\u3057\u3066\u3001\u5909\u66f4\u3057\u305f\u3002\u306a\u305c\u3001\u6025\u306b\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u306e\u304b\u3001\u306f\u3042\u308b\u304c\u3001\u3068\u308a\u3042\u3048\u305a\u3001\u30b9\u30eb\u30fc\u3002\u4fee\u6b63\u5f8c\u306f\u3001Nginx\u304c\u7121\u4e8b\u306b\u8d77\u52d5\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u6700\u521d\u306eStatus\u306e\u30ed\u30b0\u3092\u307f\u308b\u3068\u3001\u6700\u521d\u304b\u3089\u201dtry_files \u201d\u304c\u554f\u984c\u3063\u3066\u66f8\u3044\u3066\u3042\u3063\u305f\u3002\u304a\u3061\u3064\u3044\u3066\u3001\u898b\u308b\u5fc5\u8981\u3042\u308a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04\u3067\u3001PHP\u3092PHP7.2\u304b\u3089PHP7.4\u306b\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u305f\u3068\u3053\u308d\u3001\u4f5c\u696d\u5f8c\u306bOS\u3092\u518d\u8d77\u52d5\u3057\u305f\u3089\u3001Nginx\u304c\u8d77\u52d5\u3057\u306a\u304f\u306a\u3063\u305f\u3002\u539f\u56e0\u3092\u8abf\u3079\u3066\u5bfe\u51e6\u3057\u305f\u306e\u3067\u3001\u30e1\u30e2\u3092\u6b8b\u3059\u3002 Nginx\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u78ba\u8a8d\u3057\u305f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[155,48,110],"class_list":["post-4592","post","type-post","status-publish","format-standard","hentry","category-linux","tag-nginx","tag-php","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/4592","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=4592"}],"version-history":[{"count":1,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/4592\/revisions"}],"predecessor-version":[{"id":4593,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/4592\/revisions\/4593"}],"wp:attachment":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/media?parent=4592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/categories?post=4592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/tags?post=4592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}