This happens because your server is listening on port 8080, and not on port 80 which is the default (so when you type localhost you mean localhost:80).

So, you need to change your configuration to make WAMP listening on port 80. You find here how to do this: How to change port number for apache in WAMP.

Answer from mgaido on Stack Overflow
🌐
Reddit
reddit.com › r/php › a tip for those directly running "php -s localhost:8080" for testing
r/PHP on Reddit: A tip for those directly running "php -S localhost:8080" for testing
December 6, 2015 -

PHP latest versions come with this special built-in server feature and many developers (myself included) run it on Linux to quickly host and test any PHP apps. However, I would like to point out that this is insecure practice, because if the code you happen to run is untrusted, it could play havoc with your file system. Rather, a secure way is to do it this way:

sudo -H -u www-data bash -c 'php -S localhost:8080'

This way, you are starting php not as yourself, but this lowly user such as www-data. Now, you can safely run your script or app as it cannot access anything on your home partition (/home/foo). All it can access is the directory it was started in.

Of course, the proper way is to do a full-fledged apache setup and all, but whoever has that time in today's world? And apache is also getting outdated very fast, isn't it?

If you like this approach, you can even setup an alias like this in ~/.bashrc:

alias "startphp=sudo -H -u www-data bash -c 'php -S localhost:8080'"
🌐
Wrox
p2p.wrox.com › book-beginning-php-apache-mysql-web-development-isbn-978-0-7645-5744-6 › 23310-http-localhost-8080-why.html
http://localhost:8080/ (Why??) - Wrox Programmer Forums
In the book, the examples are given as: http://localhost/ Yet, to make the examples work I must append the port number, in my case :8080. Why is that?
🌐
Natanfelles
natanfelles.github.io › blog › php-server
PHP Server - Natan Felles
November 26, 2017 - If found, your settings will override the default settings. ... php = PHP_BINARY host = localhost port = 8080 root = ./public autoindex = true index = index.php error_reporting = E_ALL [ini] display_errors = 1 display_startup_errors = 1 max_execution_time = 360 post_max_size = 200M ...
🌐
PHP
php.net › manual › en › features.commandline.webserver.php
PHP: Built-in web server - Manual
I painfully experienced behaviour ... turned out, if you started the php server with "php -S localhost:80" the server will be started with ipv6 support only!...
🌐
localhost
locallhost.me
localhost | localhost 80 | localhost 8080 | http://localhost
The stack is made up of the following technologies: Linux (the environments OS), Apache (the HTTP server), MySQL (the database), and PHP (the server-side programming language). webfx · These software bundles are used to run dynamic Web sites or servers. Common ports that might be used to access localhost are:
Find elsewhere
🌐
Sololearn
sololearn.com › en › Discuss › 1213505 › local-host-localhost-8080-how-to-use-it-and-for-what-i-can
[LOCAL HOST] localhost:8080 how to use it and for what I can use it 😕??!! | Sololearn: Learn to code for FREE!
Port 8080 is reserved for an apache tomcat server. So if you want to run an apachr tomcat server on your machine, that is the way to access it. A server is nothing else than the stuff that answers you if you type google.com ...
🌐
Localhost
localhost.co › 8080
localhost:8080 - LocalHost.Co
If instead you type http://localhost:8080, the browser explicitly connects to port 8080 on your local machine. ... An alternative HTTP port when 80 is already in use or requires administrator privileges.
Top answer
1 of 2
3

In general, messing with the ports that your operating system is using just seems like a bad idea. You’ll end up with weird network issues like when trying to print.

In addition, for me having two web servers (IIS running locally for .NET projects) listening on different ports was important.

The best situation was to simply change the IP Port that Apache listens on (the default is port 80, which is the standard for all web traffic).

I changed mine to port 8666 (but it could be anything above 1024). I did the following:

  1. Locate the httpd.conf file in the following directory

    [install directory]\xampp\apache\conf

    (mine was in, C:\xampp\apache\conf)

  2. Find the line that says, "Listen 80"

  3. Change it to "Listen 8666"
  4. Save and Close the file
  5. Start or restart the Apache service in the XAMPP control panel.

Life should be good.

The only catch to this method is that you can’t just go to http://localhost/xampp any more. You have to tell your browser which port specifically to use (it will by default use 80), so you will have to use http://localhost:8666/xampp/ (the port is designated by the colon and then the number).

The cool thing is I can run http://localhost:8666 to run Apache and http://localhost:8616 to run my local IIS for .NET projects.

Note: XAMPP install path must NOT have special characters in it. Spaces are allowed, parentheses are NOT allowed. Other special characters have to be tested. Apache will not start if the XAMPP install path contains special characters such as parentheses.

2 of 2
1

You have already done the maximum. Go to the XAMPP control panel and try to do the following:

Config (right-top corner of window) > Service and Port Settings > Apache > assign your modified port number.

🌐
Stack Overflow
stackoverflow.com › q › 26072260
Newest Questions - Stack Overflow
Stack Overflow | The World’s Largest Online Community for Developers
🌐
localhost
locallhost.me › php
PHP Hypertext Preprocessor | http://localhost/php
PHP is very rich with many diverse online community developers to help beginners for web-based applications. Common ports that might be used to access PHP folder are: Access PHP folder on port 80:http://localhost:80/php · Access PHP folder ...
🌐
Edureka Community
edureka.co › home › community › categories › web development › php › i can t enter to localhost 8080 phpmyadmin
I can t enter to localhost 8080 phpmyadmin | Edureka Community
June 11, 2022 - When I tried to enter it returns - This site can't be reached: connection refused... I made ... MySQL. Can someone please help me with this issue?
🌐
localhost
httplocalhost.info › 8080
Port 8080 - Tomcat, Spring Boot, Alternative HTTP - Localhost
# application.properties server.port=8080 # Run ./mvnw spring-boot:run # Opens http://localhost:8080