{"id":178,"date":"2020-12-20T13:45:56","date_gmt":"2020-12-20T04:45:56","guid":{"rendered":"http:\/\/192.168.0.139:8080\/2020\/12\/20\/4-ubuntu%e3%81%a7nginx%e3%81%8c%e7%a8%bc%e5%83%8d%e3%81%99%e3%82%8bpc%e3%81%abphp%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab\/"},"modified":"2020-12-20T13:45:56","modified_gmt":"2020-12-20T04:45:56","slug":"4-ubuntu%e3%81%a7nginx%e3%81%8c%e7%a8%bc%e5%83%8d%e3%81%99%e3%82%8bpc%e3%81%abphp%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"http:\/\/192.168.0.139:8080\/2020\/12\/20\/178\/","title":{"rendered":"4.ubuntu\u3067nginx\u304c\u7a3c\u50cd\u3059\u308bPC\u306bPHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"\n

\u5148\u65e5\u307e\u3067\u306bubuntu Minimal\u306eVM\u3092\u65b0\u898f\u3067\u4f5c\u6210\u3057\u3001\u305d\u3053\u306bNGINX\u3001SSL\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u304d\u307e\u3057\u305f\u3002\u672c\u65e5\u306fPHP\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002
\u30a6\u30a7\u30d6\u3067PHP\u3092\u691c\u7d22\u3059\u308b\u3068PHP8\u304c\u6700\u8fd1\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u307f\u305f\u3044\u306a\u306e\u3067\u3053\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n

SSH\u63a5\u7d9a\u3092\u3057\u3066\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

sudo apt install php8.0-fpm<\/code><\/pre>\n\n\n\n

\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002
Unable to locate package php8.0-fpm<\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n

\u898b\u3064\u304b\u3089\u306a\u3044\u306e\u3067\u3001\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306ePPA\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

sudo apt install software-properties-common\nsudo add-apt-repository ppa:ondrej\/php<\/code><\/pre>\n\n\n\n

\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u306a\u3069\u306eCMS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u8ffd\u52a0\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u306a\u3044\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u306e\u3067\u3001\u305d\u308c\u3089\u3082\u542b\u3081\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

sudo apt install php8.0-fpm php8.0-common php8.0-mysql php8.0-gmp php8.0-curl php8.0-intl php8.0-mbstring php8.0-gd php8.0-xml php8.0-cli php8.0-zip<\/code><\/pre>\n\n\n\n

\u30a8\u30c7\u30a3\u30bf\u3067php.ini\u3092\u958b\u304d\u5fc5\u8981\u306a\u500b\u6240\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002
\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306e\u9650\u754c\u304c\uff12M\u3060\u3063\u305f\u308a\u3059\u308b\u306a\u3069\u3001\u3042\u3068\u3067\u652f\u969c\u304c\u3067\u306a\u3044\u3088\u3046\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n

short_open_tag = On
memory_limit = 256M
cgi.fix_pathinfo = 0
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = Asia\/Tokyo<\/p>\n\n\n\n

sudo vi \/etc\/php\/8.0\/fpm\/php.ini<\/code><\/pre>\n\n\n\n

\u6b21\u306b\u30eb\u30fc\u30c8\u306e\u5834\u6240\u3084SSL\u306e\u8a2d\u5b9a\u304c\u8a18\u8f09\u3055\u308c\u305fNGINX\u95a2\u9023\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304d\u3001PHP\u306e\u8a18\u8ff0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002NGINX\u306e\u8a2d\u5b9a\u306a\u3069\u306f\u4e0b\u8a18\u306e\u8a18\u4e8b\u3092\u53c2\u7167\u304f\u3060\u3055\u3044\u3002
https:\/\/minokamo.tokyo\/2020\/12\/17\/3001\/<\/a>
https:\/\/minokamo.tokyo\/2020\/12\/19\/3084\/<\/a><\/p>\n\n\n\n

sudo vi \/etc\/nginx\/sites-available\/minokamo.online\n\n\u8ffd\u52a0\u5185\u5bb9\n        location ~ .php$ {\n                include snippets\/fastcgi-php.conf;\n                fastcgi_pass unix:\/var\/run\/php\/php8.0-fpm.sock;\n        }<\/code><\/pre>\n\n\n\n
\"\"\/<\/figure>\n\n\n\n

NGINX\u3001PHP-FPM\u3092\u518d\u8d77\u52d5\u3057\u3066PHP-FPM\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

sudo systemctl restart nginx.service\nsudo systemctl restart php8.0-fpm.service\nsudo systemctl status php8.0-fpm<\/code><\/pre>\n\n\n\n

\u6700\u5f8c\u306b\u30eb\u30fc\u30c8\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bPHP\u306e\u60c5\u5831\u304c\u78ba\u8a8d\u3067\u304d\u308b\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

sudo vi \/var\/www\/minokamo.online\/info.php\n\n\u8a18\u8ff0\u5185\u5bb9\n<?php\nphpinfo();<\/code><\/pre>\n\n\n\n

\u30d6\u30e9\u30a6\u30b6\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n

\"\"\/<\/figure>\n\n\n\n
\n