Click to See Complete Forum and Search --> : Recognizing PHP


Anon
05-05-2001, 07:58 PM
When I am trying to edit files with the "fopen" command for example, I need to have permission to write to the file if I want to write to it via the web.
I know if I do something in cgi for example, it recognizes the script as being executed by My Username, so that only ppl via the web can change it or me. Or someone else that somehow got into my account.
Currently PHP is being recognized as 'www-data'. The problem is there are many sites on the server my website is on, that use PHP. So I can't just make PHP use my username.
Does anyone know how I could make PHP recognize the site it's being executed from (For example "http://yourserver.com/~yourusername" would make PHP use "yourusername" as the person executing the script) instead of www-data?

Anon
05-08-2001, 03:18 PM
If you make your .php files end in the extension .cgi and then the first line of your PHP file start with #!/usr/local/bin/php4 and then use suexec then it will run the PHP file as the user for that host rather than www-data.

If your confused on what I am saying send me an e-mail and I will explain more.