sudo systemctl stop apache2.service
sudo apt remove apache2
sudo apt remove "libapache2-mod-php*"
sudo add-apt-repository ppa:ondrej/nginx -y
sudo apt update
sudo apt install nginx -y
sudo systemctl enable nginx
Hope you have already installed the php-cli, lets install the glue now
sudo apt install php8.3-fpm
sudo systemctl start php8.3-fpm
- Check for syntax errors
sudo nginx -t
- Reload after updating the configurations
sudo systemctl reload nginx
You can tweak php.ini
at this location
/etc/php/8.3/fpm/php.ini