4

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!

1 Answer 1

1

You may be installed the application that sets up a virtual machine.

Go to download page again.

here: https://www.apachefriends.org/download.html

Now select "7.3.0 / PHP 7.3.0" or latest version according to your visit time without 'VM'.

Remember don't select "XAMPP-VM / PHP 7.3.0" or latest version with 'VM'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.