LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 06-20-2009, 09:33 PM   #1
noirboy
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Permissions for php script writing to directory


If an "other" user is trying to access a php page through their web browser, and this php page writes a text file to a directory "/www/mydirectory". Does this directory need to have its perrmission set to writeable?

Thank you.
 
Old 06-20-2009, 09:48 PM   #2
jhcaiced
Member
 
Registered: Mar 2009
Distribution: CentOS - Ubuntu - Debian
Posts: 83

Rep: Reputation: 27
Hi,

When some user access the php script, such process is run
with the uid of the apache/httpd process always, CentOS
for example has user 'apache' for the default pages,
other distros uses 'httpd','www' or something similar.

There is no difference if the user access your script
from the same machine or from another machine through
the network, the process is always executed with the
'apache' uid.

If your script needs to write some information, it needs
write permissions to the directory for the "apache" user.
 
  


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
Permissions for file uploading script in php emab Programming 7 08-31-2008 06:53 AM
php and bash script permissions paddyjoy Programming 2 10-04-2006 06:01 PM
php connect "active directory" script paul_mat Linux - Software 3 08-03-2006 03:24 AM
LXer: Title: PHP/MySQL Classifieds Script AddAsset1.php Script Insertion LXer Syndicated Linux News 0 07-02-2006 06:21 PM
php connect "active directory" script paul_mat Linux - Software 0 05-03-2006 08:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:54 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