Bash script to uninstall Nginx, Redis, PHP 7.4 and 8.2, MySQL, and phpMyAdmin Save this script to a file, for example uninstall-nginx-php-mysql.sh, and make it executable (chmod +x uninstall-nginx-php-mysql.sh) then run the file.
This script will stop the services, remove the packages, and clean up any leftover configuration files. Note that it assumes you're using apt package manager and that you have root or sudo privileges.