Home Free Templets Works Mind Chiller Photo Gallery Family & Friends Links
 
   
 

How to solve " failed to open stream: Permission denied in.." error for IIS

 In this short tutorial I will show you how to Avoid the "Permission denied in" IIS while installing a php script or running your own script.


Warning: fopen(../wp-config.php) [function.fopen]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\wordpress5\wp-admin\setup-config.php on line 122

This is a common problem many PHP programmers are troubled with, when developing php scripts or installing php scripts in the IIS/Windows server . This is a very common problem when you are going to install third party scripts like Wordpress, Joomla , Mambo etc. or going to write your own thumnail script or other file handling script which requires files to be modified by PHP. By default IIS on Windows give read permission on files/folders but does not give write permission to them. To avoid this problem you have to set write permission to the files/folders on IIS. I'll describe the steps that you should take to assign write permission to the files/folders in IIS.

In this tutorial I will discuss three three ways of setting wright permission to folders on IIS

1) Setting write permission in the local IIS
2) Setting write permission in online server using FTP client
2) Setting write permission in online server using CPanel

IIS for Windows XP

1) Open "My computer" by Double clicking the Icon on the desktop. Then Tools -> Folder Options(This step is not needed for windows 2000 and 2003)

Step 1

Step 2)
Now go to "View" tab and uncheck the "Use simple File sharing (Recomended)" Check box.(This step is not needed for windows 2000 and 2003)
Step 2

Step 3) Now open the root folder of IIS "C:\Inetpub\wwwroot" and select the folder/file within root folder (say Wordpress folder) , that you want to set write permission. Right click on the folder and select "properties" ( very last item in the pop up menu).
Step 3

Step 4) Now open the "Security" Tab . Here you will see the different types of users in a list and when you select any user there are checkboxes for different permissions for that user will appear. You can check/Uncheck the boxes for granting / Revoking the permission for that user. Select "Internet Guest account" and "Launch IIS Process Account " respectively and Check the read , write, execute permission.

Permission4

Setting permission through ftp client (I have used FileZile client free version here).

Step 1) Connect filezilla to the server .Right Click on the file/folder you want to assign permission .Select "File Attributes".

Filezila1

Step 2) Now assign permission as shown in the picture below.
Filezila2

Setting permission using Cpanel
Step 1) Login to your Cpanel account and goto "File manager".

Cpanel1

Step 2)
Now select the file/folder you want to assign permission in the left panel .Select "Change Permissions " in the right Panel.
Click here for Screen Shot.

Step 3) Change the premission.

Cpanel3
So this is the process how you can assign write permission to IIS folders.


Back to Tutorial Index page

Your comments are most welcome admin[AT]koderguru.com