file_put_contents, failed to open stream: Permission denied

This forum is for issues with installing Joomla! 2.5 (All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5.) on IIS webservers.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
leoqiuwr
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Fri Jan 28, 2011 8:48 am
Contact:

file_put_contents, failed to open stream: Permission denied

Post by leoqiuwr » Thu Jul 17, 2014 3:01 am

I am using php 5.4 and IIS 8.0 for a website.
There is following warning message on all the webpages except homepage:
------
Warning:file_put_contents(mydomain.com\httpdocs\attachments\.htaccess): failed to open stream: Permission denied in mydomain.com\httpdocs\libraries\joomla\filesystem\file.php on line 421
------

And the content in the .\attachments\.htaccess is below:
order deny,allow
deny from all

How can I fix the problem.
Thanks.

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: file_put_contents, failed to open stream: Permission den

Post by itoctopus » Thu Jul 17, 2014 4:51 am

You can fix the problem by giving write permissions to Apache on that file. The question is, however, which extension is trying to write to that file?
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

leoqiuwr
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Fri Jan 28, 2011 8:48 am
Contact:

Re: file_put_contents, failed to open stream: Permission den

Post by leoqiuwr » Thu Jul 17, 2014 8:30 am

Thanks, itoctopus.

I tried to set full control to the file .\libraries\joomla\filesystem\file.php and the directories.
But It doesn't work.

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: file_put_contents, failed to open stream: Permission den

Post by itoctopus » Thu Jul 17, 2014 1:37 pm

I meant the .htaccess file.
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

leoqiuwr
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Fri Jan 28, 2011 8:48 am
Contact:

Re: file_put_contents, failed to open stream: Permission den

Post by leoqiuwr » Mon Jul 28, 2014 2:35 am

Thank you, itoctopus.
The problem has been solved. It is due to the wrong permissions to the directories.

JanKrohn
Joomla! Apprentice
Joomla! Apprentice
Posts: 49
Joined: Fri Mar 18, 2011 11:09 am
Location: Phnom Penh
Contact:

Re: file_put_contents, failed to open stream: Permission denied

Post by JanKrohn » Wed Jul 05, 2017 3:51 am

Just in case anyone else comes across this thread in Google: I just encountered this issue, and installed the mpm-itk Apache module to fix it.


Locked

Return to “Joomla! 2.5 on IIS webserver”