Skip to main content

File permissions issue for world role (read/write)

Comments

3 comments

  • cPRex Jurassic Moderator
    Hey there! If your PHP script is running as the cPanel user, 600 would work as you're seeing. The 600 permissions would give read and write permissions to the owner of the file, so as long as the PHP script itself is run by the same user it would be able to write to it.
    0
  • gkaza
    Hey cPRex, Thanks for clarifying. That's what I thought. It is possible that PHP runs as the cPanel user instead of the world role. Shouldn't the php run as the world role for security reasons? At least, I would prefer it that way because it provides more flexibility. Is this some kind of configuration or is it built in the cPanel's behavior? How can I tell if this is the case?
    0
  • cPRex Jurassic Moderator
    If you're using ruid2 or suPHP as the PHP handler, the script would be executed as the cPanel user. That allows files and directories created by automated tools like WordPress to have the correct permissions to be managed by the user. If you check your PHP handler in WHM >> MultiPHP Manager you can confirm this. Were you just accessing the PHP script from a web page?
    0

Please sign in to leave a comment.