Thread: Important?

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

    Join Date
    Jul 2000
    Pune, Maharashtra, India
    Rep Power
    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.

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

    Join Date
    Apr 2000
    Rep Power
    i think we can do it using setuid function.

    check the manual for posix-setuid function.

    may other users can give more details

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

    Join Date
    Dec 1999
    Caro, Michigan
    Rep Power
    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