티스토리 뷰
반응형
✅ 1. WSL2 및 Ubuntu 설치
이미 WSL2가 설치되어 있다면 이 단계는 건너뛰세요.
- PowerShell(관리자 권한)에서 WSL2 활성화:
wsl --install
- Ubuntu 설치:
Microsoft Store에서 Ubuntu 22.04 LTS 설치 - Ubuntu 실행 후 초기 설정 (사용자 이름/비밀번호 설정)
✅ 2. 시스템 업데이트
sudo apt update && sudo apt upgrade -y
✅ 3. Nginx 설치
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
- 브라우저에서 http://localhost 확인 → Nginx 환영 페이지가 보여야 함
✅ 4. PHP 8.3 설치
PHP 8.3은 기본 apt 저장소에 없으므로 ondrej/php PPA 사용:
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt update
PHP 8.3 및 필요한 모듈 설치:
sudo apt install php8.3 php8.3-fpm php8.3-mysql php8.3-cli php8.3-curl php8.3-xml php8.3-mbstring php8.3-zip php8.3-bcmath -y
PHP-FPM 실행:
sudo systemctl start php8.3-fpm
sudo systemctl enable php8.3-fpm
✅ 5. MySQL 8 설치
sudo apt install mysql-server -y
보안 설정 (선택적):
sudo mysql_secure_installation
이 과정에서 root 비밀번호 설정, 익명 사용자 제거 등을 할 수 있음.
✅ 6. Nginx와 PHP 연동
예시 Nginx 설정:
sudo nano /etc/nginx/sites-available/default
아래처럼 수정:
server {
listen 80;
server_name localhost;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
설정 테스트 및 재시작:
sudo nginx -t
sudo systemctl reload nginx
✅ 7. PHP 테스트 페이지
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
브라우저에서 http://localhost/info.php 확인
✅ 8. MySQL 연결 테스트
sudo mysql -u root -p
반응형
'이것저것' 카테고리의 다른 글
Docker 명령어 (0) | 2025.06.04 |
---|---|
Ubuntu SSL 인증서 (0) | 2025.06.04 |
ps 프로세스 관리 (0) | 2025.05.29 |
OOP 개발 (0) | 2025.05.23 |
WSL2 설치 (1) | 2025.05.16 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- swagger
- wsl
- laravel 테스트
- WSL2
- 명령어
- mysql
- researcher
- facades
- ob_get_contents
- 비동기
- laravel 11
- jp:a
- eloquent
- flask
- curl_multi_init
- laravel 12
- privatechannel
- ubuntu
- reflectionclass
- php
- createfromformat
- uniqid
- #collect
- 설정
- array_combine
- 설치
- PYTHON
- call_user_func
- Laravel
- strict_types
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
글 보관함