Jump to content

Permissions & File Editing In PHP


jj20051

Recommended Posts

I'm attempting to create a file manager in php for a "free webhosting company," however before I begin I was wondering what you guys would recommend as far as security and permissions settings. I would like to make sure that no one user can edit another user's files (even with their own scripts) and I'd like to know exactly what I'll need to do to make sure only my script can access all of the files in the user directories.

 

As an example: I want to make sure my script can edit files on user accounts only if they are logged in...

 

I'm not exactly sure how to prevent users from accessing files that aren't theirs with their own php scripts.

 

I was looking at: http://forums.mydigitallife.info/threads/23790-Apache-Restrict-Folder-Access but I'm not sure if that will work, if it would then I'll just place that in the directory between the user's folders :)

Link to comment
Share on other sites

AFAIK, the way to handle this is with the setup and configuration of apache and php so that it uses fastcgi + suexec.  The thing that allows people to read each other's files is when you're using mod_php and the apache process has to have access to everyone's file systems.  You need a configuration where every user is running as their OS user, in their home directory. 

 

There is a long discussion of this here, and a bit of googling on php fastcgi suexec will provide you a lot more to read about.

 

Good start ->  http://forum.linode.com/viewtopic.php?t=2982

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.