PHP Permissions control

Discussion in 'Site & Server Administration' started by cc2365, Jan 4, 2009.

  1. #1
    I'm going to have a web-hosting-alike service. I'll give each user a folder for them to upload php web pages they want. For example, I open:

    /user/best_julie/ for User 1,
    /user/jack/ for User 2,
    /user/tom4392/ for User 3, and
    /user/gogojim/ for User 4.

    But since I allow them to upload *.php files, They might be able to control files outside their folder. How can I prevent that? I hope they'll be able to control files inside their folder only.
     
    cc2365, Jan 4, 2009 IP
  2. grk519

    grk519 Peon

    Messages:
    293
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How will they be uploading the files? If they have their own seperate account on the server they wont be able to access anything out of their home directory. If they are sharing an account then they will have full access to everything in the account.
     
    grk519, Jan 4, 2009 IP
  3. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #3
    Generally they should not be able to access other files outside their account until the tiles and folders are shared. But you can restrict to execute any file outside their account using open_basedir restriction in php.ini.

    Kailash
     
    kailash, Jan 4, 2009 IP