Re: [PHP] Re: Can not delete files that were uploaded

2002-07-14 Thread Michael Hall

 Be warned that if PHP can delete them, so can anybody else on the shared
 server who wants to write a PHP script to delete them, unless you've
 configured PHP specially to run as a specific user, which is unlikely for
 most ISP setups.

How can PHP be configured to run as a specific user? I'm referring to a
DSO installation, where I assume that because PHP is 'part' of Apache, it
would be the same user as Apache.



Michael Hall [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Can not delete files that were uploaded

2002-07-14 Thread Richard Lynch

 Be warned that if PHP can delete them, so can anybody else on the shared
 server who wants to write a PHP script to delete them, unless you've
 configured PHP specially to run as a specific user, which is unlikely for
 most ISP setups.

How can PHP be configured to run as a specific user? I'm referring to a
DSO installation, where I assume that because PHP is 'part' of Apache, it
would be the same user as Apache.

Apache 2.0 allows that...

Meanwhile, in *CURRENT* ISP-land :-)

Some ISPs give you *BOTH* Apache as Module (DSO) and as CGI via suExec,
using different extensions.

So for those really critical security pages that need to run as you, use the
.phpcgi (or whatever) extension and leave the rest as normal .php

Actually, I don't even know what the extension is that does .phpcgi on my
servers, I just use the ForceType directive to set the mime-type.

It's nice to be able to run a PHP script as me when I have to instead of
as nobody

Very nice.

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Can not delete files that were uploaded

2002-07-13 Thread Richard Lynch

I use PHP to upload files to the web server via web browser.  However, I can
not delete the files later cause the Redhat linux server running on safe
mode. Do I have to changed the owner of the file during the file uploading
time?

Please let me know how to solve this problems.

The files are going to get deleted unless you do something in the upload
script to save/store/copy them.

There is no problem. :-)

If, after you have created/moved them, you can't delete them, then you need
to have done stuff like:

http://php.net/umask
http://php.net/chmod

and have the correct settings on the source/destination directory
permissions to get the files in the state that you want them in -- Whether
that's deleting via a cron job, or manually or letting PHP do it.

Be warned that if PHP can delete them, so can anybody else on the shared
server who wants to write a PHP script to delete them, unless you've
configured PHP specially to run as a specific user, which is unlikely for
most ISP setups.

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Can not delete files that were uploaded

2002-07-12 Thread Dyon Beaart

You can try to 'chmod' it first :
@chmod ($myfile, 0777);
and then do an exec or passthru..
exec(rm -f $myfile);
Note the '@', if the chmod fails, he doesn't show it...

Good luck
Dyon

Anan [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 I use PHP to upload files to the web server via web browser.  However, I
can
 not delete the files later cause the Redhat linux server running on safe
 mode. Do I have to changed the owner of the file during the file uploading
 time?

 Please let me know how to solve this problems.

 Anan





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php