2

I'm trying to delete a file on the server but the PHP is still busy on it and wont let me delete it... FTP says SORRY cant do:

> DELE ml.txt
< 550 ml.txt: Permission denied
> PORT 190,028,4,31,129,100

and

> SITE CHMOD 777 ml.txt
< 550 ml.txt: Operation not permitted

What to do, in order to kill the process or delete the file?

3 Answers 3

1

try, ssh => login as root, try renaming the file and then delete it.

1
  • or else you could also try deleting the files by chmod +777
    – Anonymous
    Mar 30, 2011 at 23:59
1

Why not just stop the web server and restart?

If running php directly, simply use top to find the process and kill it.

top | grep "php"

Find the process id and then

kill "processId"

or even simpler enough:

killall php
1
  1. login as normal user on ssh
  2. then type in su -
  3. it will prompt you for the root password, then enter that.
  4. one you are in you need to change the owner ship of the file by chown -r change_with_your_username:change_with_your_usergroup change_with_full_path_to_the_file
  5. then try deleting it through ftp or ssh and it should work.

if the steps above dont work then try this

  1. if it is locked as in RCS (revision control system) or SCCS (source code control system) , you (hopefully owner) can unlock it rcs -u YourFileName see man rcs if it is installed in your system. see man sccs to learn how to unlock with sccs. unfortunately i don't know.
  2. if your file is in use, you can see it with fuser -m TheFileName or the directoryName holding it fuser is file user. see man fuser to see how to kill the process using your file. i think it is fuser -km FileName. better investigate it yourself. If you know which process is using your file you can terminate the process with kill command.
  3. use lsattr YourFileName to see the attributes of your file. it might be set as immutable or undeletable with command chattr -i filename or chattr -u filename if so you can do the opposite with chattr +i +u filename see man chattr or man lsattr for more detail. chattr and lsattr come with newer systems. my fedora2 has it. older systems don't
3
  • did it work??? let me know.. :) good luck
    – Anonymous
    Mar 31, 2011 at 0:21
  • Thanks user!! +1 again this helps. (I donno why my question got downvoted? I dont care. Your answer rocks.)
    – Sam
    Mar 31, 2011 at 0:22
  • thanks sam for the rep. I have upvoted your question because it is perfectly valid and a good question.
    – Anonymous
    Mar 31, 2011 at 3:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .