I can run bin/cake server, but when I go to localhost, it can't be found

Up until now cake has been running fine. In the terminal I type in bin/cake server and the terminal tells me the built in server is running fine, but when I go to my browser and load the server it tells me it failed to open the page because safari can’t connect to localhost. Then when I return to the terminal the built in server is no longer running, as if I had manually typed in ctrl + c.

I’m running php 5.6.38 and the latest version of cake, and up until today everything was fine. I’m lost and haven’t been able to find any help searching the web. Can anyone help?