httpwebwitch

msg:1264910 | 3:52 pm on Jul 8, 2004 (gmt 0) |
I hear your plight. Had the same crisis earlier this year. On my server, the PHP ghost was named "localhost", and I was "httpwebwitch", and neither could do anything with files from the other. If a file was created with PHP, it had to be deleted with PHP. If it was created/sent via FTP, it had to be deleted via FTP. Isn't it annoying? Back when I was having the problem, I tried a few experiments with PHP "chmod" and setting permissions from FTP, nothing worked. But be thankful it works like that. It's a security thing. It's Good. a couple of options: 1) Get the server administrator (a.k.a. superuser) to delete the files for you. 2) do just as I mention above - use PHP to delete the files. Make yourself a little script that uses unlink().
|
foy

msg:1264911 | 4:15 pm on Jul 8, 2004 (gmt 0) |
thanks for your sympathy =) I'm the admin myself, running SUSE Linux 9.1 with Apache2 and PHP with Zend. Maybe this is an issue with safe_mode? though is safe_mode is off in my php.ini...
|
m_shroom

msg:1264912 | 4:41 pm on Jul 8, 2004 (gmt 0) |
I to had the same problem but solved it. {mkdir("thumbnails/$row[3]"); chmod("thumbnails/$row[3]",0777);} Let php make it , let php chomd. [edited by: m_shroom at 4:42 pm (utc) on July 8, 2004]
|
coopster

msg:1264913 | 4:42 pm on Jul 8, 2004 (gmt 0) |
After you move_uploaded_file(), chmod the file to 0644.$uploaddir = '/var/www/uploads/'; $uploadfile = $uploaddir . $_FILES['userfile']['name']; if (@move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { print "File is valid, and was successfully uploaded. "; @chmod($uploadfile, 0644); }
|
foy

msg:1264914 | 4:45 pm on Jul 8, 2004 (gmt 0) |
I want to have the file(s) chmod 0644 but still deletable with user "wwwftp" of the group "ftpusers". So in other words it's not possible unless I chmod the files to 0777?
|
coopster

msg:1264915 | 4:46 pm on Jul 8, 2004 (gmt 0) |
Did you test it?
|
foy

msg:1264916 | 4:53 pm on Jul 8, 2004 (gmt 0) |
yes, but my problem is that i use these functions in php: fopen() fwrite() copy rename after that, I can't delete them via ftp. when I use move_uploaded_file() it works but that's not the thing I wanted to achieve since I write files with fwrite on the server itself and do not particularly upload them from a remote location.
|
coopster

msg:1264917 | 5:11 pm on Jul 8, 2004 (gmt 0) |
chmod them after those functions. It should work.
|
jatar_k

msg:1264918 | 9:19 pm on Jul 8, 2004 (gmt 0) |
or just use a clean up script using unlink
|
|