Hosts file can not be updated when creating a new site.
Steps to reproduce
When creating a new site an error appears that the hosts file can not be updated. When accessing the site an error site cannot be reached is displayed.
Environment Info
Describe your environment.
What Operating System are you using? MacOS 15.4
What versions of site software (Nginx, Apache, PHP, MySQL) is used? PHP 8.2.23 / MySQL 8.0.35
What version of Local is installed? 9.2.2+6771
Supporting info
Please provide your Local Log. See this Community Forum post for instructions on how to do so:
And then download specific releases from our page here: Releases - Local
Of course if you have any sites you want to save hopefully you’ve backed those up or exported them already but if you need to save copies they should be under your Local Sites directory.
There is a work around. Create your site, you will still get the error.
Edit the hosts file with sudo nano /etc/hosts.
Add the two lines: - ::1 sitename.local
127.0.0.1 sitename.local
sitename is the name of the site you have created in Local.
Save and exit.
You will now be able to connect to your site and work on it.