Advertisement

Failed to open stream: Permission denied

Joomla version 1.0 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

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
Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Failed to open stream: Permission denied

Post by Computer Ninja » Tue Aug 23, 2005 6:25 pm

I installed the latest Mambo (downloaded on Friday), and receive this error when trying to access my administration area:
Warning: main(/home/www/gamecheatz/language/english.php): failed to open stream: Permission denied in /home/www/gamecheatz/administrator/index.php on line 20

Warning: main(): Failed opening '/home/www/gamecheatz/language/english.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/www/gamecheatz/administrator/index.php on line 20

Warning: main(/home/www/gamecheatz/administrator/templates/mambo_admin/login.php): failed to open stream: Permission denied in /home/www/gamecheatz/administrator/index.php on line 104

Fatal error: main(): Failed opening required '/home/www/gamecheatz/administrator/templates/mambo_admin/login.php' (include_path='.:/usr/local/lib/php') in /home/www/gamecheatz/administrator/index.php on line 104
I also made sure the configuration.php file didn't have anything "errant" in it.

I have checked and quadruple checked the permissions of the language dir as well as the templates dir.

When I visit the site's main index.php page, I get an "_INSTALL_WARN" note...kind of ugly. http://www.gamecheatz.com/index.php.
The site still works at http://www.gamecheatz.com, since it's using a different index page.

Also, in an unrelated note, during the install process, it kept telling me that images/banners and images/stories weren't writeable, but they were. The same writeable note came up for mambots/content and mambots/search. After un-gzipping the install, I changed the ownsership from "gina" to the user that owns the directory on the server. I can't see that being an issue, but you never know.

Any help would be greatly appreciated.
Last edited by Computer Ninja on Tue Aug 23, 2005 6:30 pm, edited 1 time in total.
Computer Ninja

Advertisement
user deleted

Re: Failed to open stream: Permission denied

Post by user deleted » Tue Aug 23, 2005 7:19 pm

Hi,

When i visit your site i get this _install_warn. When i look in the language files it is supposed to say this:
For your security please completely remove the installation directory including all files and sub-folders  - then refresh this page
So after the install, did you remove the installation folder? Although i think this is not your issue with the warnings.

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Tue Aug 23, 2005 7:23 pm

I did not, so check it out now. It's even worse. :(
Computer Ninja

user deleted

Re: Failed to open stream: Permission denied

Post by user deleted » Tue Aug 23, 2005 7:30 pm

Hi,

The language file is actually there? And about the header warning, this is usually when a php file has one empty line at the bottom. You could go to that file and see if that is the case (for index.php) and remove an empty last line if it is there.

By the way, i have also seen warnings like this when the configuration.php is not correct. When you view this, all current variables are looking okay? They resemble your webserver settings etc?

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Tue Aug 23, 2005 7:33 pm

configuration.php looks just fine. I suppose I could check index.php in both the root and the admin folder to see if there is a blank line.
Computer Ninja

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Tue Aug 23, 2005 7:34 pm

And yes, the language files, all of them, are there.
Computer Ninja

User avatar
DeanMarshall
Joomla! Hero
Joomla! Hero
Posts: 2352
Joined: Fri Aug 19, 2005 2:26 am
Location: Lancaster, Lancashire, United Kingdom
Contact:

Re: Failed to open stream: Permission denied

Post by DeanMarshall » Tue Aug 23, 2005 7:35 pm

I have checked and quadruple checked the permissions of the language dir as well as the templates dir.
I know I am stating the obvious - but just in case, did you check the permissions of the english.php file itself?

I think the headers already sent messages on the subsequent errors are just caused by the first error being printed to the output stream.

Dean Marshall
Dean Marshall Consultancy - six Joomla experts - http://www.deanmarshall.co.uk/

Joomla Experts - Joomla Support http://www.deanmarshall.co.uk/joomla-se ... pport.html

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Tue Aug 23, 2005 7:37 pm

-rw-r--r--    1 gina    gamechea    22608 Jun  1 22:23 /www/gamecheatz/language/english.php
Computer Ninja

User avatar
DeanMarshall
Joomla! Hero
Joomla! Hero
Posts: 2352
Joined: Fri Aug 19, 2005 2:26 am
Location: Lancaster, Lancashire, United Kingdom
Contact:

Re: Failed to open stream: Permission denied

Post by DeanMarshall » Tue Aug 23, 2005 7:45 pm

Sorry,

I don't fully understand your printout - sorry I am a Windows Monkey at the core, unix/linux by osmosis.
I assume it proves that permissions are okay.

Apart from that, I hope you don't mind but I tried to access your english.php file directly and got a 403 FORBIDDEN.
Not sure whether that is you securing your server or not, but typically one gets the file and receives the 'Direct Access to this location is not allowed' warning.
My question then, have you restricted access to this location deliberately in some way - .htaccess perhaps? Or is this accidental.

Dean Marshall.
Dean Marshall Consultancy - six Joomla experts - http://www.deanmarshall.co.uk/

Joomla Experts - Joomla Support http://www.deanmarshall.co.uk/joomla-se ... pport.html

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Tue Aug 23, 2005 7:50 pm

I actually did another install in a separate directory and this time I let it do CHMOD to the files and directories at the end of the installation. Seemed to work fine this time.
Computer Ninja

user deleted

Re: Failed to open stream: Permission denied

Post by user deleted » Wed Aug 24, 2005 6:00 am

Hi,

Glad you got it working...maybe it did have something to do with giving ownership away from "gina" to sometinh else.

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Wed Aug 24, 2005 11:47 am

I think it had to do with not allowing it to do its CHMOD at the end of installation.
Computer Ninja

User avatar
DeanMarshall
Joomla! Hero
Joomla! Hero
Posts: 2352
Joined: Fri Aug 19, 2005 2:26 am
Location: Lancaster, Lancashire, United Kingdom
Contact:

Re: Failed to open stream: Permission denied

Post by DeanMarshall » Wed Aug 24, 2005 12:57 pm

I am certainly no expert on this, can't you tell, but I am not sure whether CHMOD alone would return a 403 FORBIDDEN which that one file returned - although if you had secured your server with .htaccess then this would explain that particular error.

Dean Marshall
Dean Marshall Consultancy - six Joomla experts - http://www.deanmarshall.co.uk/

Joomla Experts - Joomla Support http://www.deanmarshall.co.uk/joomla-se ... pport.html

User avatar
witmatix
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Aug 19, 2005 6:29 am
Contact:

Re: Failed to open stream: Permission denied

Post by witmatix » Wed Aug 24, 2005 10:26 pm

When changing permissions on our host, we use this procedure (the directory that Mambo is in=MamboDir):

1.  Login to shell
2.  chmod 755 MamboDir
3.  cd MamboDir
4.  find . -type f -name "*.php" -exec chmod 644 {} \;
5.  mv htaccess .htaccess

Sometimes the default .htaccess from whatever host you use can cause problems.  Best is to use the .htaccess that comes with Mambo.
------------------------
Witmatix.com Inc.
http://witmatix.com
------------------------

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Wed Aug 24, 2005 10:33 pm

I wonder if I'm having permission problems because I have Mambo in the root dir of my site rather than a Mambo directory on its own?

I seem to be having perms/owner issues with the directories Mambo requires for uploading new templates, components, mambots, and modules.
Computer Ninja

User avatar
witmatix
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Aug 19, 2005 6:29 am
Contact:

Re: Failed to open stream: Permission denied

Post by witmatix » Thu Aug 25, 2005 12:58 am

It really shouldn't matter if it is in the root directory or in a subdir. 

If you are getting permission problems when changing things through the web-based administration area, then the webserver user likely does not have the same access as your regular account username. 

Try this (in the shell):

1.  Create a new group  (groupadd newgroup)
2.  Add both your username, and the webserver username to the group (ie. 'apache', 'www', or 'nobody') (usernames in /etc/passwd, and edit your /etc/group)
3.  Change the problem directories to be owned by the new group (chgrp newgroup dirname)
4.  Grant write access to the group for the new directories (chmod -R +gw dirname)

For further details, try googling for a bash tutorial on users, groups and permissions.  If it is not obvious by now, these directions only apply to LAMP hosts. 

If all else fails, you can do a "chmod -R 777 dirname" to take off all access restrictions.  Not very secure, though your webserver will be able to write to it.
------------------------
Witmatix.com Inc.
http://witmatix.com
------------------------

Computer Ninja
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Tue Aug 23, 2005 6:09 pm
Location: Shelby Twp., MI
Contact:

Re: Failed to open stream: Permission denied

Post by Computer Ninja » Thu Aug 25, 2005 1:14 am

I would never do 777 perms. I'm not that desperate. And of course, it's a LAMP system. I'm a bit further along in my LAMP skeelz than I once was. I'm just having some problems with this, that's all. Thanks.
Computer Ninja

User avatar
Fireburst
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Sep 18, 2005 7:35 pm
Contact:

Re: Failed to open stream: Permission denied

Post by Fireburst » Sun Sep 18, 2005 8:59 pm

I have had similar problems. I have Mambo installed in root. I am trying to test Joomla in a sub directory. I uploaded all the files fine. The web based install went fine except for the fact that whist I chmod the files it tells me to make writable the following files still would show as unwritable

images/banners
images/stories
mambots/content
mambots/search

all the other files changed fine and those files chmod fine (according to my ftp client) but the install routine says not so.

When I finish the install I get this message when I try to access my site

Warning: main(language/english.php): failed to open stream: Permission denied in /home/haplo12/public_html/test/index.php on line 130

Warning: main(): Failed opening 'language/english.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/haplo12/public_html/test/index.php on line 130
_TEMPLATE_WARNrhuk_solarflare_ii

I have tried two installs one with me setting my own permissions at the end and one where I let the install set the permissions. I am not sure why Mambo installs fine yet Joomla is causing me so many problems permission wise?

Nebulous Designs
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Aug 31, 2005 12:10 pm

Re: Failed to open stream: Permission denied

Post by Nebulous Designs » Wed Sep 21, 2005 7:26 pm

Fireburst wrote: ...the following files still would show as unwritable

images/banners
images/stories
mambots/content
mambots/search

all the other files changed fine and those files chmod fine (according to my ftp client) but the install routine says not so.

I'm having the exact same problem, both with Joomla! 1.0 and 1.0.1. And when I try to view the site I get the "failed to open stream: Permission denied" problem.

User avatar
Fireburst
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Sep 18, 2005 7:35 pm
Contact:

Re: Failed to open stream: Permission denied

Post by Fireburst » Wed Sep 21, 2005 7:32 pm

Hi,

My problem was caused by me setting permmisions wrong. When I was setting write privilages to the files it lists when it installs I was also removing execute privilages. As soon as I rectified that then all was well.

I hope it is a easy fix for you also.

User avatar
mambogfx
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Thu Aug 18, 2005 10:18 pm

Re: Failed to open stream: Permission denied

Post by mambogfx » Wed Sep 21, 2005 7:40 pm

The Same probleme here, after the Update on 1.0.1 i get the same Error on my site

Nebulous Designs
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Wed Aug 31, 2005 12:10 pm

Re: Failed to open stream: Permission denied

Post by Nebulous Designs » Wed Sep 21, 2005 7:56 pm

Fireburst wrote: My problem was caused by me setting permmisions wrong. When I was setting write privilages to the files it lists when it installs I was also removing execute privilages. As soon as I rectified that then all was well.
Thanks, Fireburst! I was setting the directory permissions to 706 which is writable, but what it actually needed was 707.

Joomla!'s install check was showing some directories as writable and some as unwritable even though all of them had the exact same permissions set (706), and even when I changed the permissions to 777 the install check still showed the directories as unwritable. Therefore, it was giving no indication of what the correct permissions should be and was incorrectly indicating that 706 was acceptable for at least some of the directories.

Bottom line, the install check is buggy and confusing. But I still love Joomla!  :)

User avatar
Fireburst
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Sep 18, 2005 7:35 pm
Contact:

Re: Failed to open stream: Permission denied

Post by Fireburst » Wed Sep 21, 2005 8:36 pm

Nebulous Designs wrote:
Bottom line, the install check is buggy and confusing. But I still love Joomla!  :)
Yep, The more I use it, the more I like it :)

Advertisement

Locked

Return to “Installation - 1.0.x”