It seems like XAMPP is trying to stop Apache and MySQL, but it’s indicating that they are not running. This message typically occurs when XAMPP detects that Apache and MySQL are not currently active processes.
Error :-
Restarting XAMPP for Linux 8.1.25-0...
XAMPP: Stopping Apache...not running.
XAMPP: Stopping MySQL...not running.
XAMPP: Stopping ProFTPD...not running.
XAMPP: Starting Apache...fail.
XAMPP: Another web server is already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...fail.
XAMPP: Another FTP daemon is already running.
Solutions:-
sudo /opt/lampp/lampp status
Output:-
Version: XAMPP for Linux 8.1.25-0
Apache is not running.
MySQL is running.
ProFTPD is not running.
sudo lsof -i :80
root@ip-172-31-41-118:/opt# sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
apache2 2691659 root 4u IPv6 12227001 0t0 TCP *:http (LISTEN)
apache2 2748703 www-data 4u IPv6 12227001 0t0 TCP *:http (LISTEN)
apache2 2748704 www-data 4u IPv6 12227001 0t0 TCP *:http (LISTEN)
Now kill the pid using below command
sudo kill 2748703
Next to restart the apache server
sudo /opt/lampp/lampp restart
Now its working