permissions - EasyPHP cannot modify hosts file

07
2014-07
  • jay

    I am using the Virtual Hosts Manager module to add a virtual host so I can access my local site on the browser like so: http://mysite.local/. But I am getting this message:

    Unfortunately, you do not have rights to create a Virtual Host. You must have write permissions on the file: C:\Windows\system32\drivers\etc\hosts

    Unfortunately, you do not have rights to create a Virtual Host. You must have write permissions on the file: C:\Windows\system32\drivers\etc\hosts

    I have

    1. Given the hosts full access to my user, System and even Everyone
    2. Run EasyPHP executable as Admin

    But I still keep getting this message. Any suggestions?

  • Answers
  • jay

    Oddly giving Users (ComputerName\Users) write permissions fixed this issue!

    Write permissions for Users (ComputerName\Users)


  • Related Question

    windows 7 - How do I unprotect the hosts file?
  • Questioner

    I know that to edit the hosts file you need to launch a text editor as administrator, but that's cumbersome. I am the only person that uses my computer and I edit the hosts file quite frequently because I use the virtual hosts feature in Apache.

    Is there any way to tell Windows to just let me edit the hosts file like Windows XP does by default?


  • Related Answers
  • William Hilsum

    In Windows Explorer, go to c:\Windows\system32\drivers\etc and right click on the hosts file.

    Click Properties and go to the Security Tab.

    Click Edit and then either add Full control or Modify to the Users object if you want anyone to be able to edit it or if you are the only user who should do it, click Add and add your name as an editable object, and again choose either Full control or Modify.

    This should over write the inherited folder level permissions and you should now be able to save there as a un-elevated user.

    Alternatively, you can use an editor such as Windows Hosts File Editor (Can't recommend any, but I know a few people like this)

  • Darren Hall

    This applies to more than just editing the hosts file.

    Create Administrator Mode Shortcuts Without UAC Prompts in Windows 7 or Vista

    This works by setting up a scheduled task to run the application in Administrator mode, and then setting up a separate shortcut that tells the scheduled task to run. If that sounds difficult, it’s really not… just follow through the instructions below.

    Note: Because you are required to click through a UAC prompt to setup the scheduled task, it’s not really a security loophole.