Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
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.
I am getting this error whenever I access the page:
Code:
PHP Warning: fgets(): supplied argument is not a valid stream resource
Any idea whats all about?
I explored and found it permission issue.
I want to put a user call paul in apache group.Any idea how can I do that?
That could solve my issue..i think !!
I am getting this error whenever I access the page:
Code:
PHP Warning: fgets(): supplied argument is not a valid stream resource
Any idea whats all about?
I explored and found it permission issue.
I want to put a user call paul in apache group.Any idea how can I do that?
That could solve my issue..i think !!
Code:
useradd -G group-name username
but i doubt this is your problem as the php is going to run as the apache user right??
and anyone that accesses the page has the rights of the apache user??
what are the permissions for the file being called?
The error message by itself is not sufficient to guess it's cause. With code, you should write a small example script that replicates the issue and is postable.
As far as adding an existing user to an existing group, you'd use usermod. Check out the usermod manual page with man usermod. However, to add the user paul to the group apache, you should be able to use something like usermod --append --groups apache paul or, the short version might be usermod -aG apache paul
Before adding paul to the apache group, verify paul's current group membership with id --groups --name paul or id -Gn paul
After adding paul to the apache group, verify paul's new group membership.
Hope this solves your PHP issue, as well. Good luck.
I am Very Confused..and Let me explain.
I have few files under /var/www/html as:
Code:
ls -la | grep www
drwxrwxrwx 8 root root 4096 Nov 21 03:04 www
cd www
ls -la
total 64
drwxrwxrwx 8 root root 4096 Nov 21 03:04 .
drwxr-xr-x 25 root root 4096 Nov 21 11:07 ..
drwxrwxrwx 2 root root 4096 Jan 16 2008 cgi-bin
drwxrwxrwx 3 root root 4096 Nov 20 12:16 error
drwxrwxrwx 5 john john 4096 Nov 22 08:18 html
drwxrwxrwx 3 root root 4096 Nov 20 12:18 icons
drwxrwxrwx 14 root root 4096 Nov 20 12:18 manual
drwxrwxrwx 2 root root 4096 Nov 20 13:32 usage
cd html
ls -la
total 44
drwxrwxrwx 5 john john 4096 Nov 22 08:18 .
drwxrwxrwx 8 root root 4096 Nov 21 03:04 ..
drwxrwsr-x 2 john john 4096 Oct 30 16:50 bytype
drwxrwxr-x 2 john john 4096 Nov 22 08:08 imgs
-rw-r--r-- 1 john john 3771 Oct 30 16:50 index.html
drwxrwsr-x 2 john john 4096 Oct 30 16:50 js
-rw-rw-r-- 1 john john 9909 Nov 22 08:14 notice.php
Code:
id john
uid=501(john) gid=501(john) groups=501(john),48(apache)
Now Just want to know Does User "john" has write permission to DOCROOT
???
Especially when using a CMS, I set ownership of the html directory to the apache user using
Code:
chown -R apache:apache /var/www/html
Since usually your web server runs as user apache, this gives adequate privileges for running the scripts. I'm sure there's something wrong with that and, hopefully, someone else will add what...
But you don't need the world writeable flag on. To turn it off, use
Code:
chmod -R o-w /var/www/html
I think you can set the sticky bits on the html directory to get new files to get the same ownership by using
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.