XAMPP Ports Change On its Own

This is the full scenario i am explaining here that will clear you out :

We get a php page not responding, the first thing comes to our mind is : Is the apache service running on xampp ?

we immediately go to the xampp to check, and what we see is , the port is not 80 !!! Definitely every one will deduce the result that its port issue (same case happened to me) .

While its not the port issue. infact xampp changes the ports for it self. while requests are recieved on 80 as normal.

The real issue at that time is : that our code is not connecting to Database.

Hence . please keep in mind, there is no issue in that. Your apache is fine. Just go and check your db connection !! and cheers :)


I experienced this behaviour when using XDebug.
Everything in XAMPP was very slow, phpmyadmin or any website. Ports were changing almost on every request.
Commenting [XDebug] block on php.ini was my solution.


Same problem was answered in this post by one of XAMPP developers. Assuming this is real (quote):

In short, that is normal. Apache listens for and accepts requests on ports 80 and 443 but it does not service requests on those ports. When you or others connect to your servers, they will be handled by other connections usually using high ports. The control panel just looks for all ports associated with a module. It is just picking up those client ports and the box to show all the ports is just not big enough to show them all.

Tags:

Apache

Xampp

Port