6

I finally got PHP running on Windows 7 IIS7 but now for the life of me can't edit files in wwwroot because my editor keeps saying "You don't have permission to save to this location... save in Pete instead?"

It's going to be a very long edit/run/debug process if I have to manually copy files into wwwroot each time I want to view my website.

I go into IIS manager and go to that directories and un-click the read-only check box that is set. The problem is next time I "Edit Permissions..." it's checked again!

I'm running as Administrator.

Any ideas?

Pete Alvin
  • 281
  • 2
  • 4
  • 12

4 Answers4

5

By default only administrators have write access to C:\inetpub\wwwroot. Two options:

  1. Login with an administrator account, and elevate you editor.
  2. Set IIS to use a different directory for its root folder, on which your normal account has write/delete access.
  3. Change the permissions on C:\inetpub\wwwroot.
Richard
  • 5,324
  • 1
  • 23
  • 20
  • 1. Hey, how in the world would I pull off #1? I use UltraEdit. 2. I did this. Thanks! 3. I tried doing that... that's the problem :( – Pete Alvin Jun 26 '10 at 10:53
3

Right click on the editor and click "Run as Administrator". By default, you cannot edit files that is in the wwwroot directory. UAC prevents the files to be edited even though you are logged on to the machine as an Administrator.

Yes, alternately change the content directory from something other than c:\inetpub\wwwroot folder.

Vivek Kumbhar
  • 3,073
  • 1
  • 18
  • 13
2

Additional info: The read-only check box for a folder doesn't mean that the contents of the folder are read-only.

See: http://blogs.msdn.com/b/oldnewthing/archive/2003/09/30/55100.aspx

Individual files can be marked read-only, but the folder is controlled using permissions. If you have UAC enabled, starting Notepad elevated (Start, type Notepad, hit Ctrl+Shift+Enter) will avoid the issue. Or set permissions on the directory so that your user-level account has write access to it.

TristanK
  • 9,073
  • 2
  • 28
  • 39
-2

Yes, go to the INTERNET INFORMATION SERVER (IIS) --> RIGHT CLICK over the FILE --> Edit Permission --> Security --> Edit --> Choice all the USER or Group to give them WRITE Permission , in my case was "IIS_IUSRS" and "ADMINISTRATORS"... thats all brothers.

  • 1
    Don't *ever* give the IIS_IUSRS group write permissions. That allows any App Pool identity to write to the contents of itself. If anyone manages to revert to the App Pool identity (not common but also not prevented), that allows defacement of the website. – TristanK Feb 23 '12 at 00:08