차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| tech:php [2019/03/26 01:00] – [location.replace 인증 부분] V_L | tech:php [2025/07/27 15:58] (현재) – [safe mode 를 사용하라] V_L | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| {{tag> | {{tag> | ||
| ======PHP====== | ======PHP====== | ||
| + | |||
| + | =====설치===== | ||
| + | 업데이트 | ||
| + | |||
| + | > sudo apt update | ||
| + | > sudo apt upgrade | ||
| + | |||
| + | [[NGINX]]의 경우 | ||
| + | |||
| + | > sudo apt install php8.3-fpm | ||
| + | |||
| + | |||
| + | |||
| + | | ||
| + | 필수 확장 설치 | ||
| + | |||
| + | > sudo apt install php8.3-common php8.3-mysql php8.3-xml php8.3-xmlrpc php8.3-curl php8.3-gd php8.3-imagick php8.3-cli php8.3-dev php8.3-imap php8.3-mbstring php8.3-opcache php8.3-soap php8.3-zip php8.3-intl php8.3-sqlite3 | ||
| + | |||
| + | |||
| + | 확인 | ||
| + | |||
| + | > php -v | ||
| + | |||
| + | PHP 8.3.7 (cli) (built: May 13 2024 15:37:39) (NTS) | ||
| + | Copyright (c) The PHP Group | ||
| + | Zend Engine v4.3.7, Copyright (c) Zend Technologies | ||
| + | with Zend OPcache v8.3.7, Copyright (c), by Zend Technologies | ||
| =====기본===== | =====기본===== | ||
| 줄 1603: | 줄 1630: | ||
| php.ini 중에서 일부 | php.ini 중에서 일부 | ||
| + | |||
| < | < | ||
| ; Safe Mode | ; Safe Mode | ||
| 줄 1619: | 줄 1647: | ||
| .inc 보다는 .inc.php 로 저장 하기 ! | .inc 보다는 .inc.php 로 저장 하기 ! | ||
| httpd.conf | httpd.conf | ||
| - | <Files ~ " | + | |
| + | <file ~ " | ||
| Order allow,deny | Order allow,deny | ||
| Deny from all | Deny from all | ||
| - | </Files> | + | </file> |
| (2) turn Indexes directive to off by default per website | (2) turn Indexes directive to off by default per website | ||
| 줄 1693: | 줄 1722: | ||
| PHP 확장자는 마음대로 변경 하여 사용할 수 있다. | PHP 확장자는 마음대로 변경 하여 사용할 수 있다. | ||
| - | 아래는 윈도우에서 httpd.conf 파일 이다. 물론 리눅스도 AddType 부분은 동일 | + | 아래는 윈도우에서 httpd.conf 파일 이다. 물론 리눅스도 AddType 부분은 동일. |
| + | |||
| + | < | ||
| LoadModule php4_module c:/ | LoadModule php4_module c:/ | ||
| AddType application/ | AddType application/ | ||
| + | </ | ||
| 위에 처럼 설정 하면 | 위에 처럼 설정 하면 | ||
| .tood .tgp .cal .html .htm .include 파일에서 PHP 를 사용할 수 있다. | .tood .tgp .cal .html .htm .include 파일에서 PHP 를 사용할 수 있다. | ||
| - | 확장자만 가지고는 이 사이트가 PHP 기반인지 알 수 없다. | ||
| - | 물론 알 수 있는 방법은 많죠..그러나 단지 접속 해 보고는 알 수 없다. | ||
| - | |||
| - | index.tgp 파일...이상하게 생각 할것 이다..이게 먼 확장자 이지? | ||
| + | 확장자만 가지고는 이 사이트가 PHP 기반인지 알 수 없다. | ||
| ====세션 보안 최적화 | ====세션 보안 최적화 | ||