![]() (For me, the PHP web server would also start quite happily on port 80, incidentally. I confirmed that this is the issue by picking a port that hadn’t been reserved: php -S localhost:50080 In my case, I could see that a lot of ports were reserved, between 117: Start Port End Port You can verify if this is the case for you by running the following command (which despite advice elsewhere on the internet does not need to be in an elevated PowerShell prompt plain old no-privileges cmd will do): netsh interface ipv4 show excludedportrange protocol=tcp It turns out the problem is down to Docker and Hyper-V reserving a shed load of ports. I couldn’t disable ICS because I’m using its capabilities to provide NAT routing for Hyper-V networks. (Well I didn’t try disabling my antivirus or firewall, because c’mon!) Nothing was bound to the ports in question. More sensibly, use (e.g.) netstat to find out if something has already bound to the port. Disable antivirus (for goodness’ sake!).The “fixes” are often no more than workarounds – and in some cases, pretty bad workarounds, at that. Like me, you may already have read many “solutions”, on a whole bunch of spammy websites. ![]() Failed to listen on localhost:8080 (reason: An attempt was made to access a socket in a way forbidden by its access permissions.) Who to trust? ![]() Or maybe this problem, trying to run PHP’s built-in webserver? php -S localhost:8080 ![]() Ever have this problem, launching a Docker container (in this case, Nginx on port 8000)? Error: Unable to start container: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:8000: bind: An attempt was made to access a socket in a way forbidden by its access permissions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |