PHP Reading Writing file error. failed to open stream: Permission denied
I can not upload images and files to my php website. Reading Writing error.
Check Read/Write Permissions.
- Go to “Control Panel” – “Administrative Tools” – “Internet Information Services” (IIS)
- On the left panel click on “Local Computer” or - “Websites” – “Default Website” – right click on
- “Properties” – “Documents” – check “read” and “write”
- Click “OK” and close the window
- Go the exact location of your website directory which is mostly C:inetpubwwwroot
- Right click – “Properties” – “Web Sharing” – select “Share this Folder”
- “Edit Alias” window opens – tick “write”
- Message comes “Are you sure”. select “yes”
- click “OK”
OR
If the above solution doesn”t help than try this solution:
- Copy paste your website directory from the root folder (C:inetpubwwwroot) to any other folder
- Go to “Control Panel” – “Administrative Tools” – “Internet Information Services” (IIS)
- On the left panel click on “Local Computer” or – “Websites” - “Default Website” – right click and select “delete”
- Right click on “default websites” – select “New” – “Virtual Directory” – click “next” – Type any name in the “alias” field – give directory location (where you have copy pasted your web directory initially)
- Check all options “read”, “run”, “write”, “execute”, “browse”
- Message box opens “Are you sure you want to select both these options”. click “yes”
- Click “Finish”
if you are using linux then just change the folder permissions to 777……..
All that fuss is windows ONLY
If i am using XAMPP OR WAMP Package..How can i set permissions ?
Try the links below
* http://www.neowin.net/forum/lofiversion/index.php/t587851.html
* http://www.phpinsider.com/smarty-forum/
I tried to set permissions using the above settings and it always works. But once i was trying to install oscommerce and could not write or modify files. Hence the installation was giving me a hard time (these things always happens with IIS they say apache is the best).
Anyways the following worked for me:
I selected the directory where the files to be written existed.
Right Click – “All Tasks” – “Permission Wizard” – “Inherit of Security Settings” – “Replace all directory and file permissions” – Next – Next
Note at “Replace all directory and file permissions” you should have the following settings listed:
—————————————————————
Administrators have full access to files
Everyone can read files
Everyone can write files
Everyone can execute file
—————————————————————-
Note: I was installing oscommerce on my local computer so no security hassles if you are doing it online things might be a little different.