open the "httpd.conf" file
replace
Listen 80
ServerName localhost:80
Listen your port
ServerName localhost:your port
open the "httpd.conf" file, This file should be found in C:xamppapacheconf on Windows or in bin/apache in xampp directory for Linux
and replace following lines :
Listen 80
ServerName localhost:80
if you want to use port 5000
Listen 5000
ServerName localhost:5000
Edit /bin/apache/httpd.conf
Listen YourPort
ServerName localhost:YourPort