Try following Steps for Apache
- Go to your XAMPP installation folder. Right-click xampp-control.exe. Click "Run as administrator"
- Stop Apache service action port
- Tick this (in snapshot) check box. It will ask if you want to install as service. Click "Yes".
Go to Windows Services by typing Window + R, then typing services.msc
Enter a new service name as Apache2
(or similar)
- Set it as automatic, if you want it to run as startup.
Repeat the steps for the MySQL service