September 8th, 2000, 08:59 AM
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
September 8th, 2000, 11:08 AM
i think we can do it using setuid function.
check the manual for posix-setuid function.
may other users can give more details
September 9th, 2000, 02:21 AM
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.