sudo systemctl stop apache2.service
sudo apt remove apache2
sudo apt remove "libapache2-mod-php*"sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
https://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list
sudo apt update
sudo apt install nginx -y
sudo systemctl enable nginxHope you have already installed the php-cli, lets install the glue now
sudo apt install php8.4-fpm
sudo systemctl start php8.4-fpm- Check for syntax errors
sudo nginx -t- Reload after updating the configurations
sudo systemctl reload nginxYou can tweak php.ini at this location
/etc/php/8.4/fpm/php.ini
Reserved