bookmark - How To Delete File Using PHP Shell Script

How To Delete File Using PHP Shell Script

 
 Discussion by vhortex with 3 Replies.
 Last Update: November 26, 2006, 12:32 pm
 
bookmark - How To Delete File Using PHP Shell Script  
    
free web hosting
 
i have this problem regarding file access

seems that my admin host or the server system itself have locked up the acces to create new file, delete[unlink] a file.. change file permissions and such controls to file..

someone told me to use php shell script.. can you help me out here?

********

i just need to find out how to use php shell script and add it to my php scripts to delete a file..

thanks

Fri Nov 24, 2006    Reply    New Discussion   


You mentioned the method to remove a file using http://php.net/unlink , have you looked at that?

Why the file is locked, could be a number of reasons, you're not the owner or a super user who can remove that file, it's in use so locked for that reason and possibly a number of other reasons.

PHP Shell is just the same as using PHP on the web, it's just ran in a command line way, so it's not different than doing it through a page.

How are you trying to remove the file, via FTP? If that's not working and you can't upload a file, or edit it etc, then you might have to ask your host for support to find out why this is happening, they could be doing some server updates/changes and have locked it for these reasons so you don't corrupt anything on your server while these changes are happening.


Cheers,


MC

Fri Nov 24, 2006    Reply    New Discussion   

if it uses UNIX commands then you can simply type in
rm (file)

else you must refer to the documentation or check how to use the batch command for DOS.

xboxrulz

Sat Nov 25, 2006    Reply    New Discussion   

by shell commend its rm |file anme|
you can create your own file with the name
"delete.now" with 777 chmod that acctually is a shell file
in file get the name by run coomend, give chmod 777 and rm it
GET for shell run commend is
$1 for first
e.g
"delete.now" :
chmod 777 $1 &
rm $1

"run.php" :
<?php
$file="file.name";
system("./delete.now ".$file);
?>

i hope that helps

NoMore

Sun Nov 26, 2006    Reply    New Discussion   


Quickly Post to How To Delete File Using PHP Shell Script  w/o signup Share Info about How To Delete File Using PHP Shell Script  using Facebook, Twitter etc. email your friend about How To Delete File Using PHP Shell Script Print
Reply / Comment Ask a Question? Share / Bookmark E-Mail a Friend Print

Send XML Data To PHP Page   Send XML Data To PHP Page (0) (11) Re-order MySQL Table   Re-order MySQL Table