My Apache Ports are set to:
80 and 443
Looking at the XAMPP control panel a few hours later, I noticed the Ports had changed to
I've came across the same issue.
In my case I found a "strange" proxy config in httpd.conf.
As soon as I commented out the following lines, the issue disappeared:
<IfModule mod_proxy.c>
<IfModule mod_proxy_ajp.c>
Include "conf/extra/httpd-ajp.conf"
</IfModule>
</IfModule>
The apache port get changed frequently automatically. Someone already told that it is normal. and many developers found the solution is not enough for working area. I also found this issue basically when I try to fetch data from multiple tables using JOIN, and the multiple types of erroneous joining in the same sql statement. The erroneous data fetching harms the server methodology and occupies huge memory or return nothing for deadlocking, the ports get automatically changed and server goes to pause. With this server protect itself. So, write absolutely good and very logical SQL and fire to server. There would be another reasons also. I described here what I faced and found positive response. Thanks
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.
Please make sure that you have given right port number after your host if your My SQL required port, Generally we don't required Port in Host value.
I just made this mistake and found it.
Well, I had this problem so I got here.
I understand that this is not a problema with xampp so I started to check my code.
I was working with this code last friday.
$conn = new mysqli($host, $user, $pass, $database);
Today the code wasn't working so I have updated to this:
$conn = new mysqli($host."8000", $user, $pass, $database); //8000 is the apache port, you can change it to 80
It work's fine for me!
Hope this help you guys
you might be checking the current daemon/process ids through XAMPP control panel ..xampp does not changes port numbers on it's own.. restart your system or restart apache and you will find these numbers again changed to some other numbers..
i hope this resolves both of your queries..