Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> How To Delete File Using PHP Shell Script
vhortex
post Nov 24 2006, 08:48 PM
Post #1


Guilty Until Proven Innocent
Group Icon

Group: Members
Posts: 372
Joined: 13-April 05
Member No.: 3,937



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
Go to the top of the page
 
+Quote Post
mastercomputers
post Nov 24 2006, 10:41 PM
Post #2


BUG.SWAT.PATROL
Group Icon

Group: Members
Posts: 626
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



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

Go to the top of the page
 
+Quote Post
xboxrulz
post Nov 25 2006, 11:18 PM
Post #3


Colonel Panic
Group Icon

Group: [MODERATOR]
Posts: 2,730
Joined: 25-March 05
From: Toronto, Ontario, Canada
Member No.: 3,233



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
Go to the top of the page
 
+Quote Post
NoMore
post Nov 26 2006, 12:32 PM
Post #4


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 53
Joined: 11-November 06
Member No.: 17,170



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Trainable Anti-spam Filter Script(3)
  2. Php Script To Download File From Another Site(9)
  3. Need Help With A PHP - MySQL Registration Script(13)
  4. What Would Make A Good Registration Script?(4)
  5. How To Force A Zip File To Be Downloaded(11)
  6. Online Multiplayer Chess Script(2)
  7. Automated File Structure Creation Script(3)
  8. Authentication Script(1)
  9. Login Script(5)
  10. Please Help (php Join Script)(5)
  11. Automatic/remote Php Script Execution(9)
  12. Php File Upload(3)
  13. Something Wrong With This Script?(9)
  14. Extplorer(7)
  15. Automated Product Suggestion Script(2)
  1. Run A Script When Expires A Session(6)
  2. Php Script Help(1)
  3. SQL Doesn't Connect In PHP Script(19)
  4. Warning: Mysql_result(): Supplied Argument Is Not A Valid Mysql Result Resource In ...(4)
  5. Password Recovery Script(6)
  6. Login Script(8)
  7. Free Forum Hosting Type Script Help!(2)
  8. Script Request(2)
  9. Writing And Testing My Own Login Script [solved](20)
  10. Make A Script Run Even If No User Is Online(6)
  11. How To Create/edit/delete Ftp Accounts With Php(1)
  12. Php Login Script(0)
  13. Myspacetv Download Php Script Help(6)


 



- Lo-Fi Version Time is now: 5th September 2008 - 05:48 AM