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 OverflowPHP 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'"
PHP 5.4 and later have a built-in web server these days.
You simply run the command from the terminal:
cd path/to/your/app
php -S 127.0.0.1:8000
Then in your browser go to http://127.0.0.1:8000 and boom, your system should be up and running. (There must be an index.php or index.html file for this to work.)
You could also add a simple Router
<?php
// router.php
if (preg_match('/\.(?:png|jpg|jpeg|gif)
_SERVER["REQUEST_URI"])) {
return false; // serve the requested resource as-is.
} else {
require_once('resolver.php');
}
?>
And then run the command
php -S 127.0.0.1:8000 router.php
References:
- https://www.php.net/manual/en/features.commandline.webserver.php
- https://www.php.net/manual/en/features.commandline.options.php
Install and run XAMPP:
Updated link for download https://www.apachefriends.org/download.html
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:
Locate the httpd.conf file in the following directory
[install directory]\xampp\apache\conf
(mine was in, C:\xampp\apache\conf)
Find the line that says, "Listen 80"
- Change it to "Listen 8666"
- Save and Close the file
- 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.
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.
have you successfully completed step one of the tutorial?
it is talking about port 8888 and jetty and not port 8080 and glassfish.
I see "localhost" so I presume you're testing locally (I don't know GWT) On SSH, try : netstat -tupan to get the list of listening ports and the associated program name And try to read the end of Apache's error_log to see what's happening.