{"id":604,"date":"2024-08-22T14:17:45","date_gmt":"2024-08-22T05:17:45","guid":{"rendered":"http:\/\/www.bluebee.co.kr\/?p=604"},"modified":"2025-07-11T14:41:01","modified_gmt":"2025-07-11T05:41:01","slug":"ubuntu-php7-4-%ec%85%8b%ed%8c%85","status":"publish","type":"post","link":"http:\/\/www.bluebee.co.kr\/?p=604","title":{"rendered":"ubuntu \ubc18\ubcf5 \uc14b\ud305 \uba54\ubaa8"},"content":{"rendered":"<p>php \ube4c\ub4dc \ud328\ud0a4\uc9c0 \uc800\uc7a5\uc18c \ucd94\uac00<\/p>\n<pre class=\"prettyprint\">add-apt-repository ppa:ondrej\/php<\/pre>\n<p>php \uc124\uce58<\/p>\n<pre class=\"prettyprint\">apt install php7.4 php7.4-fpm php7.4-mysql php7.4-gd php7.4-curl php7.4-mbstring php7.4-gmp php7.4-soap php7.4-zip php7.4-xml\napt install php8.1 php8.1-fpm php8.1-mysql php8.1-gd php8.1-curl php8.1-mbstring php8.1-gmp php8.1-soap php8.1-zip php8.1-xml\n\n#vi \/etc\/php\/8.1\/fpm\/pool.d\/www.conf\nuser = engineer\ngroup = engineer\nsecurity.limit_extensions = .php .php3 .php4 .php5 .php7 .html\n\n502 bad gateway \ubc1c\uc0dd\uc2dc\n;listen = \/run\/php\/php8.1-fpm.sock\nlisten = 127.0.0.1:9000\n#service php8.1-fpm restart\n\nram 4gb \ud658\uacbd\uc758 pm \uc124\uc815\n; www.conf \ud30c\uc77c\uc5d0\uc11c\npm = dynamic\npm.max_children = 20          ; 4GB \ud658\uacbd\uc5d0 \ub9de\uac8c \uc870\uc815\npm.start_servers = 3\npm.min_spare_servers = 2\npm.max_spare_servers = 4\npm.max_requests = 300         ; \uba54\ubaa8\ub9ac \ub204\uc218 \ubc29\uc9c0\n\n; \uba54\ubaa8\ub9ac \uc81c\ud55c\nphp_admin_value[memory_limit] = 128M\nrequest_terminate_timeout = 300\n\n; \ub85c\uadf8 \ud65c\uc131\ud654\ncatch_workers_output = yes\nphp_admin_flag[log_errors] = on\nphp_admin_value[error_log] = \/var\/log\/php8.3-fpm.log\n<\/pre>\n<p>nginx \uc124\uce58<\/p>\n<pre class=\"prettyprint\">apt install nginx\nnginx: [emerg] socket() [::]:80 failed \ubc1c\uc0dd\uc2dc\n=&gt; listen [::]:80 default_server; \ubc14\uc778\ub529 \ubd80\ubd84 \uc8fc\uc11d\ucc98\ub9ac\n\nPermission denied \ubc1c\uc0dd\uc2dc\nvi \/etc\/nginx\/nginx.conf\n=&gt; user engineer \ub85c \ubcc0\uacbd\nvi \/etc\/nginx\/sites-available\/test.co.kr\nlocation ~ \\.(php|html)$ {\n\tinclude snippets\/fastcgi-php.conf;\n\n\tfastcgi_pass 127.0.0.1:9000;\n\n\tfastcgi_read_timeout 300;\n\tfastcgi_connect_timeout 60;\n\tfastcgi_send_timeout 300;\n\n\tfastcgi_buffers 8 16k;\n\tfastcgi_buffer_size 32k;\n\n\tproxy_read_timeout 300;\n\tproxy_buffers 64 16k;\n}\n<\/pre>\n<p>\uc124\uc815<\/p>\n<pre class=\"prettyprint\">vi \/etc\/php\/7.4\/apache2\/php.ini\nshort_open_tag = Off\nmax_input_time = 60 #\ubb34\uc81c\ud55c: -1\nmemory_limit = 128M #upload \uad00\ub828\npost_max_size = 30M\nupload_max_filesize = 20M\nmax_file_uploads = 10\n\n<\/pre>\n<p>mysql<\/p>\n<pre class=\"prettyprint\">vi \/etc\/mysql\/mariadb.conf.d\/50-server.cnf\nbind-address = 0.0.0.0\n# service mariadb restart\n<\/pre>\n<p>\uba54\ubaa8\ub9ac swap 2GB \uc2a4\uc651 \ud30c\uc77c \uc0dd\uc131<\/p>\n<pre class=\"prettyprint\">sudo fallocate -l 2G \/swapfile\nsudo chmod 600 \/swapfile\nsudo mkswap \/swapfile\nsudo swapon \/swapfile\n\n# \ubd80\ud305 \uc2dc \uc790\ub3d9 \ub9c8\uc6b4\ud2b8\necho '\/swapfile none swap sw 0 0' | sudo tee -a \/etc\/fstab\n<\/pre>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>php \ube4c\ub4dc \ud328\ud0a4\uc9c0 \uc800\uc7a5\uc18c \ucd94\uac00 add-apt-repository ppa:ondrej\/php php \uc124\uce58 apt install php7.4 php7.4-fpm php7.4-mysql php7.4-gd php7.4-curl php7.4-mbstring php7.4-gmp php7.4-soap php7.4-zip php7.4-xml apt install php8.1 php8.1-fpm php8.1-mysql php8.1-gd php8.1-curl php8.1-mbstring php8.1-gmp php8.1-soap php8.1-zip php8.1-xml #vi \/etc\/php\/8.1\/fpm\/pool.d\/www.conf user = engineer group = engineer security.limit_extensions = .php .php3 .php4 .php5 .php7 .html 502 bad gateway \ubc1c\uc0dd\uc2dc ;listen = \/run\/php\/php8.1-fpm.sock listen = 127.0.0.1:9000 #service php8.1-fpm restart ram 4gb \ud658\uacbd\uc758 pm \uc124\uc815 ; www.conf \ud30c\uc77c\uc5d0\uc11c pm = dynamic pm.max_children = 20 ; 4GB \ud658\uacbd\uc5d0 \ub9de\uac8c \uc870\uc815 pm.start_servers = 3 pm.min_spare_servers = 2 pm.max_spare_servers = 4 pm.max_requests = 300 ; \uba54\ubaa8\ub9ac \ub204\uc218 \ubc29\uc9c0 ; \uba54\ubaa8\ub9ac \uc81c\ud55c php_admin_value[memory_limit] = 128M request_terminate_timeout = 300 ; \ub85c\uadf8 \ud65c\uc131\ud654 catch_workers_output = yes php_admin_flag[log_errors] = on php_admin_value[error_log] = \/var\/log\/php8.3-fpm.log nginx \uc124\uce58 apt install nginx nginx: [emerg] socket() [::]:80 failed \ubc1c\uc0dd\uc2dc =&gt; listen [::]:80 default_server; \ubc14\uc778\ub529 \ubd80\ubd84 \uc8fc\uc11d\ucc98\ub9ac Permission denied \ubc1c\uc0dd\uc2dc vi \/etc\/nginx\/nginx.conf =&gt; user engineer \ub85c \ubcc0\uacbd vi \/etc\/nginx\/sites-available\/test.co.kr location ~ \\.(php|html)$ { include snippets\/fastcgi-php.conf; fastcgi_pass 127.0.0.1:9000; fastcgi_read_timeout 300; fastcgi_connect_timeout 60; fastcgi_send_timeout 300; fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; proxy_read_timeout 300; proxy_buffers 64 16k; } \uc124\uc815 vi \/etc\/php\/7.4\/apache2\/php.ini short_open_tag = Off max_input_time = 60 #\ubb34\uc81c\ud55c: -1 memory_limit = 128M #upload \uad00\ub828 post_max_size = 30M upload_max_filesize = 20M max_file_uploads = 10 mysql vi<a class=\"moretag\" href=\"http:\/\/www.bluebee.co.kr\/?p=604\">\ub354\ubcf4\uae30&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[],"class_list":["post-604","post","type-post","status-publish","format-standard","hentry","category-dev"],"_links":{"self":[{"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=604"}],"version-history":[{"count":15,"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/604\/revisions"}],"predecessor-version":[{"id":672,"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/604\/revisions\/672"}],"wp:attachment":[{"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=604"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bluebee.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}