What issue or error are you experiencing?
After installation when creating a new site, I get the error “Unable to update the hosts file make sure it’s not locked by antivirus” no matter what I do. I have followed all directions and then some in other threads with the same or similar errors.
- I do not have anti virus software other than basic Windows 10
- Local is given all firewall permissions
- My hosts file is NOT read only
- I have repeatedly fresh installed both for just my user and for all users
- I uninstalled my VPN
- I checked if things were listening on the ports, there do not appear to be
- I uninstalled xampp
- I have run as administrator
- I have installed and tried with no programs running, firewall turned off, and window’s real time virus thing off as well
- Local appears to have all permissions needed
- I tried installing on my partner’s computer and it worked as expected, so it’s definitely something about my particular laptop. The only difference I noticed is that during the creation of a new site on that computer there was a pop up asking for permission for command to make changes to the computer, which was granted. I am NOT given this pop up on the computer where installation isn’t working. I don’t know why this would happen or how to get the pop up to work on this laptop
I suspect this is the relevant line of the verbose logs file:
{"class":"HostsFileService","level":"debug","message":"Updating hosts with command","thread":"main","timestamp":"2024-02-28T00:55:25.558Z","updateCommand":"C:\\Users\\Ronan\\AppData\\Local\\Programs\\Local\\Local.exe","updateCommandArgs":["%%appPath%%\\main\\dns\\workers\\updateHostsFileWorker.js","test.local","www.test.local"]}
{"class":"HostsFileService","error":{},"exitCode":{},"level":"error","message":"Could not update hosts.","stderr":{},"stdout":{},"thread":"main","timestamp":"2024-02-28T00:55:25.633Z"}{"class":"HostsFileService","level":"debug","message":"Updating hosts with command","thread":"main","timestamp":"2024-02-28T00:55:25.558Z","updateCommand":"C:\\Users\\Ronan\\AppData\\Local\\Programs\\Local\\Local.exe","updateCommandArgs":["%%appPath%%\\main\\dns\\workers\\updateHostsFileWorker.js","test.local","www.test.local"]}
{"class":"HostsFileService","error":{},"exitCode":{},"level":"error","message":"Could not update hosts.","stderr":{},"stdout":{},"thread":"main","timestamp":"2024-02-28T00:55:25.633Z"}
The only thing I can think of that may be relevant that I’ve done lately is I recently installed a CLI tool that required I add a new path to the system paths. I also needed to add the path to allow the netstat command to work to check the ports.
Here’s a picture of what’s in my path variable. I compared it to the other computer and while they’re different it doesn’t seem like anything was glaringly absent from my computer
If there’s something that should be there and isn’t, let me know and I’ll add it and give it a try.
Aside from that I’m at a loss as to why this is happening. My end goal is to migrate a live WP site to my local computer so I can stop paying for hosting and extended PHP support and I’d very much like to use this program rather than trying to set up xampp. Any help getting it to work is greatly appreciated. Let me know if there’s any more screen shots or files I can upload to help.
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
Install Local, create new site, choose preferred, name site test, create test log in, continue, get error.
System Details
-
Local Version:
8.2.1-windows -
Operating System (OS) and OS version:
Windows 10 os
Build 19045.4046 if that’s relevant
Local Logs
Attach your Local Logs here (Help Doc - Retrieving Local’s Log)
local-lightning-verbose.log (12.1 KB)
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.