LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-25-2009, 02:18 PM   #1
migabriel.84
LQ Newbie
 
Registered: Nov 2009
Posts: 1

Rep: Reputation: 0
Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0


hello

My problem is that I get an error no matter what code I wrote.


Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

Fatal error: Unknown: Failed opening required '/home/site/public_html/test.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0

I have a home server with fedora 11 OS.
uname -r
2.6.30.9-96.fc11.i686.PAE


the path to the sources is /home/<username>/public_html
the permission of the dir <username> is 711
and the permission to public_html/* are 755
user and group <username>

the httpd user and group is apache

phpmyadmin works fine and is installed using yum

I try everything I can find on net but with no success.

thanks
 
Old 11-25-2009, 03:36 PM   #2
WhisperiN
Member
 
Registered: Jun 2009
Location: Middle East
Distribution: Slackware 13.1, CentOS 5.5
Posts: 137

Rep: Reputation: 17
Quote:
Originally Posted by migabriel.84 View Post
the path to the sources is /home/<username>/public_html
the permission of the dir <username> is 711
and the permission to public_html/* are 755
user and group <username>

the httpd user and group is apache
Hello,

I have passed into may cases like yours, and the solution I'll give to you will mostly solve it..!!

Now, as your Apache (httpd) runs under the name Apache..
Then, he's accessing data which are owned by another user <username>.
This way, many things would results in a Permission Denies error message.

Any way, there is complicated and there is easy solution for this, but I'll go through the easy one. I guess it will satisfy your needs, since it's a Home Server.

Simply, you either change apache to run under the name <username> which I don't really recommend.
Or, change the the owner of public_html folder to be Apache.

Code:
cd /home/<username>
chown -R apache.apache public_html
After that, give the public folders 755 permission..
and the public files 644.

In my own opinion, I hope I'm not mistaken, this will give you a very good level of security..!!

Other solutions, is to use something like fast_cgi which will run apache under the name of <username>, this is if you have more than one <username>.

Any other opinions are welcomed..

Last edited by WhisperiN; 11-25-2009 at 03:41 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
move_uploaded_file failed to open stream: Permission denied zawmn83 Linux - Server 3 05-04-2009 03:36 AM
Warning: (null)(): no MySQL-Link resource supplied in Unknown on line 0 dezza Programming 1 02-05-2009 06:02 PM
Unknown Netbios Packets to Unknown Network fukawi2 Linux - Networking 2 09-17-2007 06:41 PM
Unknown error (or warning) seen while the system boot. trainee Slackware 5 07-05-2007 12:26 AM
Slapd can`t authenticate (fd=11 DENIED from unknown (127.0.0.1)) Wistoka Linux - Software 0 11-15-2006 02:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration