Thread: Important?

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Pune, Maharashtra, India
    Posts
    86
    Rep Power
    15
    I am creating a script in PHP and using it to modify some files in my LINUX server and creating some directories in the server in the /home directory of the server unfortunately the script gives the error Permission denied error while the scripts are kept in /home/httpd/html folder with owner of the script as ROOT. If I modify the owner f the files which have to be modified (I know it is not right but just for checking) to nobody the script runs very well . Can any body help out of this.


    ------------------
    Nikunj
    MYSQL/PHP/XML
    ** Expertise comes with experiece ** Nikunj
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    thane
    Posts
    50
    Rep Power
    0
    i think we can do it using setuid function.

    check the manual for posix-setuid function.

    may other users can give more details

    ranjeet
  4. #3
  5. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,642
    Rep Power
    4492
    PHP is probably running as 'nobody' there fore it can't modify the files because they are owned by root. You can have php run as 'root' (not recommended) or make sure that whatever it runs as, the file and scripts it accesses are under it or owned 'nobody'

    I'm not real familiar with permissions in unix, so this is an idea, don't quote me.

    ---John Holmes...

Similar Threads

  1. Nothing important to say.....just sharing
    By san_diego_coder in forum Dev Shed Lounge
    Replies: 4
    Last Post: October 9th, 2003, 10:53 AM
  2. Replies: 5
    Last Post: October 15th, 2002, 01:30 PM
  3. what is more important to you?
    By webmasterj in forum PHP Development
    Replies: 28
    Last Post: July 17th, 2002, 01:56 PM
  4. closing database connections, important?
    By bakedbean in forum PHP Development
    Replies: 3
    Last Post: April 16th, 2002, 03:41 PM
  5. mysql_close, how important?
    By johan in forum MySQL Help
    Replies: 5
    Last Post: June 5th, 2001, 01:06 AM

IMN logo majestic logo threadwatch logo seochat tools logo