How does PHP read/write/execute?

  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

Does PHP use the permissions set on the user who is currently logged in to the server and run under those permission? Or does it create a temporary user on the system? Or does it use the "Everyone" group? I mean if I set a file that I nor anyone else has permission to read/write/or execute, will PHP be locked out from that file? Who's permissions would have to be set on a file for PHP to read/write to the file?
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

you chmod it, depends on the function. but yea 777 is usually fine.
  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

Yeah, I was more curious as to which user/group the PHP processes fall under. 777 gives read/read/execute to everyone, but I'd like to know which specific group/user PHP uses when executing a script that effects a file.
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

chmod [options] mode[,mode] file1 [file2 ...]

7 full
6 read and write
5 read and execute
4 read only
3 write and execute
2 write only
1 execute only
0 none

Then there is Global rights/user rights and admin rights one digit each. (Just making a note for others)

r read read a file or list a directory's contents
w write write to a file or directory
x execute execute a file or recurse a directory tree
X special execute
s setuid/gid
t sticky

So php would need a few of these functions to be able to work. you would need at least +rx to run i think.

655 is usually safe, but then again i have never really had permission issues with php unless installing pre made software like SMF. i think i am going to do some research about it

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 93 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.