Installing LEMP on Ubuntu 22.04
1. Nginx
apt install nginx -y
systemctl enable nginx
systemctl start nginx2. MySQL
apt install mysql-server -y
mysql_secure_installation3. PHP
apt install php8.2-fpm php8.2-mysql php8.2-curl php8.2-gd php8.2-mbstring -y4. Configure Nginx for PHP
Edit /etc/nginx/sites-available/default:
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
include fastcgi_params;
}