Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-05-2005, 01:15 AM
|
#1
|
Member
Registered: Oct 2004
Location: Lubbock, TX, USA
Distribution: Ubuntu 7.10
Posts: 74
Rep:
|
why "permission denied" though chmod 666?
I encountered a very strange problem today.
My PHP script can't open files whose privilege is 666.
Warning: fopen(./home_page/zzm.txt): failed to open stream: Permission denied in /www/index.php on line 294
Warning: fgets(): supplied argument is not a valid stream resource in /www/index.php on line 295
Warning: fclose(): supplied argument is not a valid stream resource in /www/index.php on line 297
Warning: fopen(./home_page/zzm.txt): failed to open stream: Permission denied in /www/index.php on line 298
Warning: fputs(): supplied argument is not a valid stream resource in /www/index.php on line 299
Warning: fclose(): supplied argument is not a valid stream resource in /www/index.php on line 300
Warning: fopen(./home_page/zzm2.txt): failed to open stream: Permission denied in /www/index.php on line 304
Warning: fputs(): supplied argument is not a valid stream resource in /www/index.php on line 305
Warning: fclose(): supplied argument is not a valid stream resource in /www/index.php on line 306
But their privilege is 666 now:
-rw-rw-rw- 1 root root 4484 May 24 21:38 zzm2.txt
-rw-rw-rw- 1 root root 1 May 21 21:29 zzm.txt
can any one help me?
|
|
|
10-05-2005, 03:14 AM
|
#2
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596
Rep:
|
Can you open the file with vi?
You should check the access rights at the directory level and at the filesystem level.
PS : this is not a networking question.
|
|
|
10-05-2005, 05:56 AM
|
#3
|
Member
Registered: Oct 2004
Location: Lubbock, TX, USA
Distribution: Ubuntu 7.10
Posts: 74
Original Poster
Rep:
|
yes.I can edit it via vi.And I am the root.
|
|
|
10-05-2005, 06:39 AM
|
#4
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596
Rep:
|
Probably php security settings then...
I don't know much about php sorry. I hope someone will help, good luck.
|
|
|
10-05-2005, 06:56 AM
|
#5
|
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783
Rep:
|
What are the permissions in ./home_page ?
|
|
|
10-08-2005, 02:41 AM
|
#6
|
Member
Registered: Oct 2004
Location: Lubbock, TX, USA
Distribution: Ubuntu 7.10
Posts: 74
Original Poster
Rep:
|
666
|
|
|
10-08-2005, 03:48 AM
|
#7
|
Senior Member
Registered: Aug 2005
Posts: 1,755
Rep:
|
Make sure the enclosing directories are 755 or 711 or something like that. You need execute permission (the "1" bit) to access the contents of a directory.
|
|
|
10-09-2005, 11:25 PM
|
#8
|
Member
Registered: Oct 2004
Location: Lubbock, TX, USA
Distribution: Ubuntu 7.10
Posts: 74
Original Poster
Rep:
|
I am puzzled.
What is the difference between r and x,if x is need to access the directory?
|
|
|
10-10-2005, 12:52 AM
|
#9
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
On a directory, read permissions let you see what files are in that directory, and execute permissions allow you to change into that dirtectory.
|
|
|
10-10-2005, 12:33 PM
|
#10
|
Senior Member
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783
Rep:
|
Permission in directories:
read: being able to read the context of a directory (doing ls on the directory)
write being able to write a file in the directory
execute being able to enter in the directory (with cd) (write and read have no point without execute).
Last edited by perfect_circle; 10-10-2005 at 12:34 PM.
|
|
|
10-10-2005, 10:50 PM
|
#11
|
Member
Registered: Oct 2004
Location: Lubbock, TX, USA
Distribution: Ubuntu 7.10
Posts: 74
Original Poster
Rep:
|
oh i see
I assume x means run a binary file or shell script
and now I use
chmod a+x /my/directory -R
and it's ok
but I can't use
chmod 666 /my/directory -R
to enable http access to /my/directory
it's funny
Last edited by baosheng; 10-10-2005 at 10:52 PM.
|
|
|
10-10-2005, 11:38 PM
|
#12
|
Member
Registered: Nov 2004
Location: Kerala, India
Distribution: Debian Bookworm
Posts: 773
Rep:
|
check the attributes with 'lsattrib' command
|
|
|
10-10-2005, 11:40 PM
|
#13
|
Member
Registered: Oct 2005
Location: Bangalore,India
Distribution: Debian
Posts: 37
Rep:
|
What you can do is just disable SElinux option and try. This might solve your problem. To disable SElinux do:
press ALT+F2. In dialog box write system-config-security and press enter. In security dialog box disable SElinux option. and reboot.
|
|
|
All times are GMT -5. The time now is 03:59 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|