I just moved my dev environment from an older machine to a new MAC. I like to use MAMP for my general local environment (simpler projects) but for some reason, the recent version of MAMP wants me to use port 8888 for my localhost.
I changed it back to port 80 which is what I had on MAMP on my old machine, and I have some absolute dev links so I don't want the hassle of putting localhost:8888 instead of just localhost at the beginning of my Uri:s
The result was that no resource could be accessed, everything was forbidden. Change the port back to 8888 and it works fine.
Why do I get this behavior?
Someone else seems to have had this same issue a month back (Can't connect to port 80 in MAMP on MAc) with no solution.
------------------ update
lsof -I tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google 973 mattias 28u IPv6 0x269b774a91275221 0t0 TCP localhost:54383->localhost:http (CLOSE_WAIT)
Google 973 mattias 36u IPv6 0x269b774a91275881 0t0 TCP localhost:54384->localhost:http (CLOSE_WAIT)
httpd 5444 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5445 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5446 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5447 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5448 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5449 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5461 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5468 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5476 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5477 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
httpd 5478 mattias 4u IPv6 0x269b774a912738a1 0t0 TCP *:http (LISTEN)
Also, http://localhost/MAMP/ works fine
When I try to access any of my own folders in the webroot I get forbidden:
If I try a first-level folder (i e http://localhost/myapp/, located in webroot/myapp) I get only
Forbidden You don't have permission to access this resource.
But if I try a subfolder or a PHP file such as http://localhost/myapp/subfolder/ or http://localhost/myapp/subfolder/index.php
then I instead get
Forbidden You don't have permission to access this resource. Server unable to read htaccess file, denying access to be safe
If I configure MAMP to use a different port it all works fine. But I don't want to have to specify a port in my route in dev env since the app I'm working on has some hard-coded Uri:s.
Also, this is a weird behaviour that annoys me =) My other MAC isn't doing this so I'd like to get to the bottom of it...
------- another update
I have moved my web root (htdocs I believe MAMP called it by default) into my user folder (user/Home/Documents/www) if it is somehow permission related, but I don't understand why it then works fine under port 8888 but not under 80... it's not like Apache gets access to my folder based on what port it's running off of...
------- requested info
I occasionally start a node server just to check a guy's work but not running at the moment. When it's on it runs under port 3000-something.
.htaccess of my web/ folder: RewriteEngine on RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.domain-name.com$ RewriteCond %{REQUEST_URI} !folder/ RewriteRule (.*) /folder/$1 [L]
Mac version Big Sur 11.3.1
MAMP version 6.3
