0

I have a script to upload files, after uploading file the owner of files are 48 (Apache) and when I trying to delete that files with FTP, I get the access denied error, the ftp owner id is 500.

I have CentOS without control panel, I install the apache and php and another things with yum command .

what should I do in apache and php configuration ?because I don't want change the owner of files each time manually .

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
MajAfy
  • 3,007
  • 10
  • 47
  • 83

1 Answers1

1

After uploading with PHP, do a chmod("file.txt", 0777), which will make the file writable by all users (including your FTP account).

kuba
  • 7,329
  • 1
  • 36
  • 41
  • Thanks, but the problem is owner of file (chown) the chmod function will change the attribute of file. – MajAfy Aug 08 '12 at 10:34
  • True, but with 0777 permissions, you will be able to write/delete this file from your FTP account, even when owned by other user. – kuba Aug 08 '12 at 12:11