farjam
farjam

Reputation: 2299

Cannot add a new host after upgrading to MAMP Pro

After upgrading to MAMP Pro, I'm not able to add a new host to serve my Laravel application. When setting up the "Document root", I point it to my Laravel's public folder and I receive the following message:

The selected folder is a sub-folder of another host's document root, or identical to another document root! This is not allowed.

Screen shot showing the error received from MAMP Pro

It does allow me to select the directory above public.

I've tried to grep that path on my Mac to see if it's been defined somewhere else as a virtual host that I'm not aware of, and it doesn't return anything. How can I resolve this issue?

The only host defined right now on MAMP Pro is the default localhost.

Upvotes: 0

Views: 961

Answers (3)

Drupal Developer
Drupal Developer

Reputation: 1

I came across the same issue after updating to MAMP Pro 7, and i found it has default host named localhost created which is having root directory pointing to Sites/localhost, so when we try to place another site under localhost directory it throws the same error.

The workaround is to edit the root directory of default localhost to something like Sites/localhost/SOME-DIR and then save the changes after that we can add another hosts as 6 version.

Upvotes: 0

Ralph
Ralph

Reputation: 51

It seems that MAMP PRO 7 has this issue where MAMP PRO 6 does not came across this.

what i did was "mv ~/Sites/localhost/projectname ~/Sites/projectname"

then i have no issue adding public folder to new sites.

it seems like localhost somehow occupied everything and not allowing to add subfolder of localhost to new sites.

Upvotes: 0

xsinisa
xsinisa

Reputation: 124

It seems that is required that the document root is in ~/Sites. After moving projects to that folder, all is fine, and possible to add new hosts without issues.

Upvotes: 1

Related Questions