I am trying to switch web development from Windows to Mac but I have encountered a problem which would need me to alter a lot of existing code.
I am running Apache and MySQL using XAMPP.
Basically, I want to access a PHP Rest API which I have created on a Windows system where I can access it like this:
http://localhost/api/read.php
However, on Mac I have to access it like this (with XXX.XXX.XX.X being my local IP address) which works perfectly fine:
http://XXX.XXX.XX.X/api/read.php
But when I try to access localhost (the same way as I did on Windows) I get an error:
Safari cannot establish a connection to the server.
Safari cannot open the site "localhost", because Safari cannot establish a connection to the server.
Is there a way to "enable" access via localhost on Mac without using the IP address?
Thank you in advance!