<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>개인 서버에 php8(php8.3)을 설치하기 &#8211; 준우블로그</title>
	<atom:link href="https://junewoo.com/tag/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-php8php8-3%EC%9D%84-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0/feed/" rel="self" type="application/rss+xml" />
	<link>https://junewoo.com</link>
	<description>또 하나의 준우블로그 사이트</description>
	<lastBuildDate>Sat, 16 Mar 2024 13:03:07 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
<site xmlns="com-wordpress:feed-additions:1">199246569</site>	<item>
		<title>개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8</title>
		<link>https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/</link>
					<comments>https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/#respond</comments>
		
		<dc:creator><![CDATA[cvilla]]></dc:creator>
		<pubDate>Wed, 06 Mar 2024 16:55:31 +0000</pubDate>
				<category><![CDATA[우분투서버 만들기]]></category>
		<category><![CDATA[default 파일에서 index.php를 추가]]></category>
		<category><![CDATA[개인 서버에 php8(php8.3)을 설치하기]]></category>
		<category><![CDATA[자주 쓰이는 php8.3 모듈을 설치]]></category>
		<guid isPermaLink="false">https://junewoo.com/?p=1558</guid>

					<description><![CDATA[<p>Contents 1. 개인 서버 만들기, 파워, 케이스, 메인보드, CPU쿨러, SSD, 메모리(RAM), CPU 선정과 주문 조립 2. 공유기 설정하기, 공유기1 브릿지 모드 설정, iptime 공유기2 IPTV ... <a title="개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8" class="read-more" href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/" aria-label="개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8에 대해 더 자세히 알아보세요">더 읽어보기</a></p>
<p>The post <a rel="nofollow" href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/">개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8</a> appeared first on <a rel="nofollow" href="https://junewoo.com">준우블로그</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Contents</p>
<table style="border-collapse: collapse; width: 100%; height: 375px;">
<tbody>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;">1. <a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-1/">개인 서버 만들기, 파워, 케이스, 메인보드, CPU쿨러, SSD, 메모리(RAM), CPU 선정과 주문 조립</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-2/">2. 공유기 설정하기, 공유기1 브릿지 모드 설정, iptime 공유기2 IPTV 연결 설정<br />
</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-3/">3. 개인 서버에 Ubuntu 22.04.4 LTS 설치하기, Universal-USB-Installer를 사용하여 부팅 가능한 USB를 생성하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-4/">4. 개인 PC에 우분투 서버 접속용 3가지 SSH 설치, <span style="font-size: inherit; font-family: inherit;">자료실의 Putty, </span>EditPlus, <span style="font-size: inherit; font-family: inherit;">FileZilla 다운 후 설치하기</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-5/">5. 우분투 서버 환경 date 설정하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-6/">6. 웹 서버 Nginx 설치, <span style="font-size: inherit; font-family: inherit;">현재 iptables 규칙 초기화</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-7/">7. Ubuntu sever 폴더 권한 설정, <span style="font-size: inherit; font-family: inherit;">Nginx 페이지의 내용 수정과 권한 설정</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px; background-color: #dfeb07;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-8/">8. Nginx 서버에 PHP8.3 설치, <span style="font-size: inherit; font-family: inherit;">자주 쓰이는 php8.3 모듈 설치하기</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%EA%B0%9C%EC%9D%B8-%EC%84%9C%EB%B2%84%EC%97%90-ubuntu-lemp-wordpress-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0-9/">9. apt update와 upgrade가 완료 후 mariadb를 설치하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-10/">10. MariaDB 관리 도구 phpMyAdmin 설치하기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-11/">11. 아사달에서 도메인 연결하기, <span style="font-size: inherit; font-family: inherit;">카페24에서 도메인 연결하기</span></a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-12/">12. HTTPS 적용을 위한 SSL 인증서 발급, <span style="font-size: inherit; font-family: inherit;"><span style="font-size: inherit; font-family: inherit;">Nginx에 acme-challenge 폴더 위치를 알리기 위하여 letsencrypt.conf 파일 만들기, </span></span>Let’s Encrypt SSL 발급 받기</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-13/">13. MariaDB에서 데이터베이스(DB) 만들기, phpMyAdmin에서 DB생성</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-14/">14. 워드프레스 설치, 우분투 서버에 ko.wordpress.org/latest-ko_KR.zip 파일 설치, wordpress.zip 파일 압축 풀기, 서버 폴더 소유자 권한 및 사용자 그룹 변경</a></td>
</tr>
<tr style="height: 25px;">
<td style="width: 100%; height: 25px; background-color: #f5f5f2;"><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-15/">15. 워드프레스 설치 후 환경 설정, 우분투 서버에 wp-config.php에 임시디렉토리 설정, FTP 연결 정보 입력, Putty로 php.ini, nginx.conf를 수정</a></td>
</tr>
</tbody>
</table>
<h2>개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8</h2>
<p>개인 서버에 Ubuntu sever LEMP(Linux-ubuntu+Nginx+MariaDB-Phpmyadmin+PHP8.3) WORDPRESS 설치하기</p>
<p>PHP7과 PHP8는 몇 가지 차이점이 있습니다. 1.성능 향상, 2.새로운 기능 추가, 3.타입 시스템 개선, 4.문법 개선 등의 차이점이 있습니다. 이러한 변화는 PHP 애플리케이션의 성능을 크게 향상 시키고, 개발자들이 더 효율적이고 안전한 코드를 작성할 수 있도록 도와줍니다.</p>
<ul>
<li>PHP 7 : Zend Engine 3을 도입하여 PHP 5.6 대비 약 2배의 성능 향상을 제공합니다. 메모리 사용량도 줄어듭니다.</li>
<li>PHP 7 : 타입 선언이 강화되어 스칼라 타입(예: int, float, string, bool)을 함수의 매개변수와 반환 값에 사용할 수 있게 되었습니다. 또한, 엄격한 타입 모드(strict mode)를 지원합니다.</li>
<li>PHP 8 : JIT(Just In Time) 컴파일러가 도입되어 특정 상황에서 성능이 크게 향상될 수 있습니다. 특히, CPU 바운드 연산에서 그 차이가 두드러집니다.</li>
<li>PHP 8 : 유니온 타입, mixed 타입 등이 추가되어 더욱 유연한 타입 선언이 가능해졌습니다. 또한, 이름이 있는 인자(named arguments), match 표현식 등 새로운 문법이 도입되어 코드의 가독성과 유지 보수성이 향상되었습니다.</li>
</ul>
<h2>8-1. Nginx 서버에 PHP8 설치를 하겠습니다.</h2>
<p>현재 서버 상태를 확인하기 위해서, 명령창에 sudo apt-cache policy php 라고 입력합니다.</p>
<pre id="code_1590813649608" class="html xml" data-ke-language="html" data-ke-type="codeblock"><code>junewoo@cvilla:~$ sudo apt-cache policy php</code></pre>
<p>현재 인스톨은 되어 있지 않으며 8.3 버전에 대한 설치 정보를 가지고 있다고 합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">php:
  Installed: (none)
  Candidate: 2:8.3+94+ubuntu22.04.1+deb.sury.org+2
  Version table:
     2:8.3+94+ubuntu2 500
        500 http://ap-seoul-1-ad-1.clouds.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
</code></pre>
<h2>8-2. 최신 버전의 php를 설치하기 위하여 apt 정책을 최신으로 업데이트 해보겠습니다.</h2>
<p>명령창에 sudo add-apt-repository ppa:ondrej/php 라고 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo add-apt-repository ppa:ondrej/php</span>
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ jammy main'
Description:
Co-installable PHP versions: PHP 5.6, PHP 7.x, PHP 8.x and most requested extensions are included. Only Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided. Don't ask for end-of-life PHP versions or Ubuntu release, they won't be provided.

Debian oldstable and stable packages are provided as well: https://deb.sury.org/#debian-dpa

You can get more information about the packages at https://deb.sury.org

IMPORTANT: The -backports is now required on older Ubuntu releases.

BUGS&amp;FEATURES: This PPA now has a issue tracker:
https://deb.sury.org/#bug-reporting

CAVEATS:
1. If you are using php-gearman, you need to add ppa:ondrej/pkg-gearman
2. If you are using apache2, you are advised to add ppa:ondrej/apache2
3. If you are using nginx, you are advised to add ppa:ondrej/nginx-mainline
   or ppa:ondrej/nginx

PLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https://donate.sury.org/

WARNING: add-apt-repository is broken with non-UTF-8 locales, see
https://github.com/oerdnj/deb.sury.org/issues/56 for workaround:

# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
More info: https://launchpad.net/~ondrej/+archive/ubuntu/php
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Found existing deb entry in /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Adding deb entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Found existing deb-src entry in /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/ondrej-ubuntu-php-jammy.list
Adding key to /etc/apt/trusted.gpg.d/ondrej-ubuntu-php.gpg with fingerprint 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C
Hit:1 http://kr.archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://kr.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:3 http://kr.archive.ubuntu.com/ubuntu jammy-backports InRelease
Get:4 http://kr.archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://kr.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1,433 kB]
Get:6 http://kr.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [1,523 kB]
Get:7 http://kr.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,053 kB]
Hit:8 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Get:9 http://kr.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [1,217 kB]
Get:10 http://kr.archive.ubuntu.com/ubuntu jammy-security/main Translation-en [220 kB]
Get:11 http://kr.archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [1,495 kB]
Get:12 http://kr.archive.ubuntu.com/ubuntu jammy-security/restricted Translation-en [248 kB]
Ign:13 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
Ign:13 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
Ign:13 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
Err:13 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
  Cannot initiate the connection to ftp.harukasan.org:443 (2001:470:23:440::2). - connect (101: Network is unreachable) Could not connect to ftp.harukasan.org:443 (175.214.128.79). - connect (111: Connection refused) Could not connect to ftp.harukasan.org:443 (118.38.208.102), connection timed out
Fetched 7,419 kB in 38s (195 kB/s)
Reading package lists... Done
W: Failed to fetch https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu/dists/bionic/InRelease  Cannot initiate the connection to ftp.harukasan.org:443 (2001:470:23:440::2). - connect (101: Network is unreachable) Could not connect to ftp.harukasan.org:443 (175.214.128.79). - connect (111: Connection refused) Could not connect to ftp.harukasan.org:443 (118.38.208.102), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
junewoo@cvilla:~$</code></pre>
<p>&nbsp;</p>
<p>중간에 Press [ENTER] to continue or Ctrl-c to cancel adding it. 라고 나오는데 docker 등 필수 패키지 정보를 설치하겠다는 겁니다. 여기서 ENTER를 누르시면 됩니다.</p>
<h2>8-3. 다음으로 apt-get도 업데이트 합니다.</h2>
<p>명령창에 sudo apt-get update 라고 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo apt-get update</span>
Hit:1 http://kr.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://kr.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://kr.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://kr.archive.ubuntu.com/ubuntu jammy-security InRelease
Hit:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy InRelease
Ign:6 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
Ign:6 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
Ign:6 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
Err:6 https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu bionic InRelease
  Cannot initiate the connection to ftp.harukasan.org:443 (2001:470:23:440::2). - connect (101: Network is unreachable) Could not connect to ftp.harukasan.org:443 (175.214.128.79). - connect (111: Connection refused) Could not connect to ftp.harukasan.org:443 (118.38.208.102), connection timed out
Reading package lists... Done
W: Failed to fetch https://ftp.harukasan.org/mariadb/repo/10.4/ubuntu/dists/bionic/InRelease  Cannot initiate the connection to ftp.harukasan.org:443 (2001:470:23:440::2). - connect (101: Network is unreachable) Could not connect to ftp.harukasan.org:443 (175.214.128.79). - connect (111: Connection refused) Could not connect to ftp.harukasan.org:443 (118.38.208.102), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
junewoo@cvilla:~$</code></pre>
<p>&nbsp;</p>
<h2>8-4. 다음 서버의 php에 대한 apt 캐시 정책을 재확인합니다.</h2>
<p>명령창에 다시 한번 sudo apt-cache policy php 라고 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">Last login: Wed Mar  6 21:17:30 2024 from 192.168.0.1
junewoo@cvilla:~$ <span style="color: #ff0000;">sudo apt-cache policy php</span>
php:
  <span style="color: #000000;">Installed: (none)
  Candidate: 2:8.3</span>+94+ubuntu22.04.1+deb.sury.org+2
  Version table:
     2:8.3+94+ubuntu22.04.1+deb.sury.org+2 500
        500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages
     2:8.1+92ubuntu1 500
        500 http://kr.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
junewoo@cvilla:~$</code></pre>
<p>&nbsp;</p>
<h2>8-5. 최신 버전이 8.3로 확인 되어 php8(php8.3)을 설치해 보겠습니다.</h2>
<p>기타 8.2나 8.0 버전을 설치하시고자 하시면 php8.2-fpm이나 php8.0-fpm으로 변경하여 입력하시면 됩니다.</p>
<p>중간에 After this operation, 18.7 MB of additional disk space will be used. 라고 물으며 이어서 할 것이냐고 묻습니다.</p>
<p>Do you want to continue? [Y/n] 여기서 Y를 하시면 됩니다.</p>
<p>명령창에 sudo apt-get install php8.3-fpm 라고 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo apt-get install php8.3-fpm</span>
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  php8.3-cli php8.3-common php8.3-opcache php8.3-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  php8.3-cli php8.3-common php8.3-fpm php8.3-opcache php8.3-readline
0 upgraded, 5 newly installed, 0 to remove and 1 not upgraded.
Need to get 4,992 kB of archives.
After this operation, 22.5 MB of additional disk space will be used.
<span style="color: #ff0000;">Do you want to continue? [Y/n] y</span>
Get:1 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-common amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [755 kB]
Get:2 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-opcache amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [370 kB]
Get:3 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-readline amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [13.6 kB]
Get:4 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-cli amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [1,923 kB]
Get:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-fpm amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [1,929 kB]
Fetched 4,992 kB in 17s (286 kB/s)
Selecting previously unselected package php8.3-common.
(Reading database ... 113652 files and directories currently installed.)
Preparing to unpack .../php8.3-common_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-common (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-opcache.
Preparing to unpack .../php8.3-opcache_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-opcache (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-readline.
Preparing to unpack .../php8.3-readline_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-readline (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-cli.
Preparing to unpack .../php8.3-cli_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-cli (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-fpm.
Preparing to unpack .../php8.3-fpm_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-fpm (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.3-common (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/calendar.ini with new version

Creating config file /etc/php/8.3/mods-available/ctype.ini with new version

Creating config file /etc/php/8.3/mods-available/exif.ini with new version

Creating config file /etc/php/8.3/mods-available/fileinfo.ini with new version

Creating config file /etc/php/8.3/mods-available/ffi.ini with new version

Creating config file /etc/php/8.3/mods-available/ftp.ini with new version

Creating config file /etc/php/8.3/mods-available/gettext.ini with new version

Creating config file /etc/php/8.3/mods-available/iconv.ini with new version

Creating config file /etc/php/8.3/mods-available/pdo.ini with new version

Creating config file /etc/php/8.3/mods-available/phar.ini with new version

Creating config file /etc/php/8.3/mods-available/posix.ini with new version

Creating config file /etc/php/8.3/mods-available/shmop.ini with new version

Creating config file /etc/php/8.3/mods-available/sockets.ini with new version

Creating config file /etc/php/8.3/mods-available/sysvmsg.ini with new version

Creating config file /etc/php/8.3/mods-available/sysvsem.ini with new version

Creating config file /etc/php/8.3/mods-available/sysvshm.ini with new version

Creating config file /etc/php/8.3/mods-available/tokenizer.ini with new version
Setting up php8.3-readline (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/readline.ini with new version
Setting up php8.3-opcache (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/opcache.ini with new version
Setting up php8.3-cli (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
update-alternatives: using /usr/bin/php8.3 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar8.3 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar8.3 to provide /usr/bin/phar.phar (phar.phar) in auto mode

Creating config file /etc/php/8.3/cli/php.ini with new version
Setting up php8.3-fpm (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/fpm/php.ini with new version
Created symlink /etc/systemd/system/multi-user.target.wants/php8.3-fpm.service → /lib/systemd/system/php8.3-fpm.service.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for php8.3-cli (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Processing triggers for php8.3-fpm (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

Restarting services...
Service restarts being deferred:
 /etc/needrestart/restart.d/dbus.service
 systemctl restart networkd-dispatcher.service
 systemctl restart systemd-logind.service
 systemctl restart unattended-upgrades.service

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
junewoo@cvilla:~$</code></pre>
<p>&nbsp;</p>
<h2>8-6. 다음으로 그 외 자주 쓰이는 php8.3 모듈을 설치해 보겠습니다.</h2>
<p>명령창에 sudo apt-get install php8.3-curl php8.3-gd php8.3-mysql php8.3-mbstring php8.3-xml php8.3-zip php8.3-imagick php8.3-bcmath -y zip unzip 를 입력합니다.</p>
<p>After this operation, 3509 kB of additional disk space will be used. 라고 물으며 이어서 설치 할 것인지 묻습니다.</p>
<p>Do you want to continue? [Y/n] 이렇게 나오면 Y를 선택합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo apt-get install php8.3-curl php8.3-gd php8.3-mysql php8.3-mbstring php8.3-xml php8.3-zip php8.3-imagick php8.3-bcmath -y zip unzip</span>
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
zip is already the newest version (3.0-12build2).
unzip is already the newest version (6.0-26ubuntu3.2).
The following NEW packages will be installed:
  php8.3-bcmath php8.3-curl php8.3-gd php8.3-imagick php8.3-mbstring
  php8.3-mysql php8.3-xml php8.3-zip
0 upgraded, 8 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,043 kB of archives.
After this operation, 3,240 kB of additional disk space will be used.
Get:1 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-imagick amd64 3.7.0-4+ubuntu22.04.1+deb.sury.org+2 [125 kB]
Get:2 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-bcmath amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [16.8 kB]
Get:3 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-curl amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [40.5 kB]
Get:4 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-gd amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [32.9 kB]
Get:5 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-mbstring amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [538 kB]
Get:6 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-mysql amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [131 kB]
Get:7 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-xml amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [129 kB]
Get:8 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 php8.3-zip amd64 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 [30.4 kB]
Fetched 1,043 kB in 6s (184 kB/s)
Selecting previously unselected package php8.3-imagick.
(Reading database ... 113766 files and directories currently installed.)
Preparing to unpack .../0-php8.3-imagick_3.7.0-4+ubuntu22.04.1+deb.sury.org+2_amd64.deb ...
Unpacking php8.3-imagick (3.7.0-4+ubuntu22.04.1+deb.sury.org+2) ...
Selecting previously unselected package php8.3-bcmath.
Preparing to unpack .../1-php8.3-bcmath_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-bcmath (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-curl.
Preparing to unpack .../2-php8.3-curl_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-curl (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-gd.
Preparing to unpack .../3-php8.3-gd_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-gd (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-mbstring.
Preparing to unpack .../4-php8.3-mbstring_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-mbstring (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-mysql.
Preparing to unpack .../5-php8.3-mysql_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-mysql (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-xml.
Preparing to unpack .../6-php8.3-xml_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-xml (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Selecting previously unselected package php8.3-zip.
Preparing to unpack .../7-php8.3-zip_8.3.3-1+ubuntu22.04.1+deb.sury.org+1_amd64.deb ...
Unpacking php8.3-zip (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Setting up php8.3-curl (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/curl.ini with new version
Setting up php8.3-zip (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/zip.ini with new version
Setting up php8.3-mysql (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/mysqlnd.ini with new version

Creating config file /etc/php/8.3/mods-available/mysqli.ini with new version

Creating config file /etc/php/8.3/mods-available/pdo_mysql.ini with new version
Setting up php8.3-mbstring (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/mbstring.ini with new version
Setting up php8.3-bcmath (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/bcmath.ini with new version
Setting up php8.3-xml (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/dom.ini with new version

Creating config file /etc/php/8.3/mods-available/simplexml.ini with new version

Creating config file /etc/php/8.3/mods-available/xml.ini with new version

Creating config file /etc/php/8.3/mods-available/xmlreader.ini with new version

Creating config file /etc/php/8.3/mods-available/xmlwriter.ini with new version

Creating config file /etc/php/8.3/mods-available/xsl.ini with new version
Setting up php8.3-imagick (3.7.0-4+ubuntu22.04.1+deb.sury.org+2) ...
Setting up php8.3-gd (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...

Creating config file /etc/php/8.3/mods-available/gd.ini with new version
Processing triggers for php8.3-fpm (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Processing triggers for php8.3-cli (8.3.3-1+ubuntu22.04.1+deb.sury.org+1) ...
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

Restarting services...
Service restarts being deferred:
 /etc/needrestart/restart.d/dbus.service
 systemctl restart networkd-dispatcher.service
 systemctl restart systemd-logind.service
 systemctl restart unattended-upgrades.service

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
junewoo@cvilla:~$</code></pre>
<p>&nbsp;</p>
<h2>8-7. php8.3 설치가 완료 되었습니다. php 버전을 확인해 보겠습니다.</h2>
<p>명령어 창에서 php -v 를 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">php -v</span>
PHP 8.3.3-1+ubuntu22.04.1+deb.sury.org+1 (cli) (built: Feb 15 2024 18:38:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.3-1+ubuntu22.04.1+deb.sury.org+1, Copyright (c), by Zend Technologies
junewoo@cvilla:~$</code></pre>
<p>php8.3 버전이 잘 설치되었다고 나타납니다.</p>
<p>php8.3 fpm을 시작합니다.  명령어 창에서 sudo service php8.3-fpm start 를 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo service php8.3-fpm</span> <span style="color: #ff0000;">start</span>
junewoo@cvilla:~$</code></pre>
<p>&nbsp;</p>
<p>지금까지 php는 설치되었으나, Nginx가 사실 웹 페이지(php)를 읽지는 못합니다. 웹서버인 Nginx가 php를 읽을 수 있도록 수정을 해 보겠습니다.</p>
<h2>8-8. Nginx의 사용 권한을 확인하고 권한을 설정합니다.</h2>
<p>명령어 창에서 ls -l /etc/nginx/sites-available/ 를 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ ls -l /etc/nginx/sites-available/ 
total 4
-rw-r--r-- 1 root root 2929 Dec 23 18:32 default
</code></pre>
<p>소유 권한도 root고 사용자 그룹도 root입니다.</p>
<p>명령어 창에서 sudo chgrp junewoo /etc/nginx/sites-available/default 를 입력 사용자 그룹 권한을 junewoo로 변경합니다.</p>
<p>명령어 창에서 sudo chmod 775 /etc/nginx/sites-available/default 를 입력하여 파일 권한을 775로 변경합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo chgrp ubuntu /etc/nginx/sites-available/default</span>
junewoo@cvilla:~$ <span style="color: #ff0000;">sudo chmod 775 /etc/nginx/sites-available/default</span>
junewoo@cvilla:~$ ls -l /etc/nginx/sites-available/
total 4
-rw-rw-r-- 1 root junewoo 2929 Dec 23 18:38 default
</code></pre>
<p>이제 EditPlus에서 /etc/nginx/sites-available/ 에 위치한 default 파일을 수정할 수 있습니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ ls -l /etc/nginx/sites-avail
able/
total 4
-rwxrwxr-x 1 root junewoo 2929 Dec 23 18:40 default
junewoo@cvilla:~$</code></pre>
<h2>8-9. default 파일에서 index.php를 추가해 보겠습니다.</h2>
<p>EditPlus에서 /etc/nginx/sites-available/default 파일을 열어서 index.php를 추가합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or WordPress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
	listen 80 default_server;
	listen [::]:80 default_server;

	# SSL configuration
	#
	# listen 443 ssl default_server;
	# listen [::]:443 ssl default_server;
	#
	# Note: You should disable gzip for SSL traffic.
	# See: https://bugs.debian.org/773332
	#
	# Read up on ssl_ciphers to ensure a secure configuration.
	# See: https://bugs.debian.org/765782
	#
	# Self signed certs generated by the ssl-cert package
	# Don't use them in a production server!
	#
	# include snippets/snakeoil.conf;

	root /var/www/html;

	# Add index.php to the list if you are using PHP
	index <span style="color: #ff0000;">index.php</span> index.html index.htm index.nginx-debian.html;

	server_name _;</code></pre>
<p>그 다음 # pass PHP scripts to FastCGI server 아래에 PHP 설정파일의 경로와 보안설정을 추가합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">	# pass PHP scripts to FastCGI server
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/run/php/php7.4-fpm.sock;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
		include fastcgi_params;
		fastcgi_read_timeout 300;
	}

	location ~ /\.ht {
	    deny all;
	}</code></pre>
<p>• default파일에 도메인 및 https(SSL 보안설정) 추가 시, 조금 더 내용을 추가 할 예정입니다.</p>
<h2>8-10. nginx에 설정에 문제가 없는지 확인합니다.</h2>
<p>명령어 창에서 sudo nginx -t 를 입력합니다.</p>
<p>/etc/nginx/nginx.conf syntax is ok        &lt;- 에서 Nginx 설정의 문법이 문제 없다고 나옵니다.</p>
<p>/etc/nginx/nginx.conf test is successful  &lt;- 에서 Nginx가 정상적으로 test 동작한다고 나옵니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo nginx -t</span>
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
junewoo@cvilla:~$</code></pre>
<p>다음으로 Nginx를 재구동 하겠습니다.</p>
<p>명령어 창에서 sudo systemctl reload nginx 를 입력합니다.</p>
<p>명령어 창에서 sudo service nginx restart 를 입력합니다.</p>
<pre id="code_1633400140094" class="bash" style="margin: 20px auto 0px; display: block; overflow: auto; padding: 20px; color: #383a42; background: #f8f8f8; font-size: 14px; font-family: 'SF Mono', Menlo, Consolas, Monaco, monospace; border: 1px solid #ebebeb; line-height: 1.71; cursor: default; z-index: 1; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" data-ke-language="bash" data-ke-type="codeblock"><code class="hljs">junewoo@cvilla:~$ <span style="color: #ff0000;">sudo systemctl reload nginx</span>
junewoo@cvilla:~$ <span style="color: #ff0000;">sudo service nginx restart</span></code></pre>
<p>이제 Nginx가 재구동 되었습니다.</p>
<h2>8-11. php가 정상적으로 뜨는지 확인하겠습니다.</h2>
<p>EditPlus에서 /var/www/html/에서 index.php를 만들어 봅니다.</p>
<p>파일들이 있는 곳(index.nginx-debian.html)에서 마우스 오른쪽을 눌러 새로 작성을 누릅니다.</p>
<p>그 후에 index.php를 입력합니다.</p>
<p><img data-recalc-dims="1" fetchpriority="high" decoding="async" class="alignnone wp-image-1606" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C.jpg?resize=860%2C825&#038;ssl=1" alt="" width="860" height="825" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C.jpg?resize=300%2C288&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C.jpg?resize=1024%2C983&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C.jpg?resize=768%2C737&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C.jpg?w=1126&amp;ssl=1 1126w" sizes="(max-width: 860px) 100vw, 860px" /></p>
<p>본문 안에 &lt;?php phpinfo(); ?&gt;를 입력하시면 됩니다. 모두 지우고 &lt;?php phpinfo(); ?&gt; 만 입력하셔도 됩니다.</p>
<p><img data-recalc-dims="1" decoding="async" class="alignnone wp-image-1607" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-1.jpg?resize=860%2C513&#038;ssl=1" alt="" width="860" height="513" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-1.jpg?resize=300%2C179&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-1.jpg?resize=1024%2C611&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-1.jpg?resize=768%2C458&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-1.jpg?w=1173&amp;ssl=1 1173w" sizes="(max-width: 860px) 100vw, 860px" /></p>
<h2>8-12. 이제 http://ipaddress/index.php 를 입력하고 확인합니다.</h2>
<p>php 8.3 버전이 설치된 화면이 나오면 됩니다. 아래 사진은 php 8.1.9 입니다.</p>
<p><img data-recalc-dims="1" decoding="async" class="alignnone wp-image-1609" src="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/image-1.jpg?resize=860%2C490&#038;ssl=1" alt="" width="860" height="490" srcset="https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/image-1.jpg?resize=300%2C171&amp;ssl=1 300w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/image-1.jpg?resize=1024%2C585&amp;ssl=1 1024w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/image-1.jpg?resize=768%2C438&amp;ssl=1 768w, https://i0.wp.com/junewoo.com/wp-content/uploads/2024/03/image-1.jpg?w=1151&amp;ssl=1 1151w" sizes="(max-width: 860px) 100vw, 860px" /></p>
<p>다음에는 MariaDB를 설치해 보겠습니다.</p>
<h2><a href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-9/">9. 개인 서버에 Ubuntu LEMP WORDPRESS 설치하기</a></h2>
<div class='kakaotalk_link' style='float:right;'><a href="javascript:SendKakao('준우블로그', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/');"><img data-recalc-dims="1" src="https://i0.wp.com/junewoo.com/wp-content/plugins/kakao-talk-link/kakaotalk.png?w=860&#038;ssl=1" alt='Smart phone only'></a></div><div class="korea-sns"><div class="korea-sns-post korea-sns-pos-left"><div class="korea-sns-button korea-sns-facebook" OnClick="SendSNS('facebook', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/facebook.png');"></div><div class="korea-sns-button korea-sns-twitter" OnClick="SendSNS('twitter', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/twitter.png');"></div><div class="korea-sns-button korea-sns-telegram" OnClick="SendSNS('telegram', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/telegram.png');"></div><div class="korea-sns-button korea-sns-naverband" OnClick="SendSNS('naverband', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/naverband.png');"></div><div class="korea-sns-button korea-sns-naverblog" OnClick="SendSNS('naverblog', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/naverblog.png');"></div><div class="korea-sns-button korea-sns-copyurl" OnClick="SendSNS('copyurl', '개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8 - 준우블로그', 'https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/', '', 0);"  style="background-image:url('https://junewoo.com/wp-content/plugins/korea-sns/icons/copyurl.png');"></div></div><div style="clear:both;"></div></div><p>The post <a rel="nofollow" href="https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/">개인 서버에 Ubuntu LEMP WORDPRESS 설치하기 8</a> appeared first on <a rel="nofollow" href="https://junewoo.com">준우블로그</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://junewoo.com/%ea%b0%9c%ec%9d%b8-%ec%84%9c%eb%b2%84%ec%97%90-ubuntu-lemp-wordpress-%ec%84%a4%ec%b9%98%ed%95%98%ea%b8%b0-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1558</post-id>	</item>
	</channel>
</rss>
