I am trying to create a script that I have accessible by
http://server.host.name/scriptname.php. The script will need to download a file from a website and move it into a directory such as /home/username/public_html. It seems to be that the only way this script will work is if it runs as root.
The script, when you access through http, does not work because it does not have permission to move files into the other directory without it being CHMODed to 0777. I said okay, I can take care of that, but then I remembered that the script is unable to change permissions on the directory because, well, it doesn't have permission! It would need to be running as root to change the permissions of a directory in a different part of the file system................. right?
By the way, I DO have root access to the machine. So my question is, is there any way to access this script through http and have it run as root? If not, is there any other way to get this to work.
Hopefully this is clear to everyone.