Jump to content
xisto Community
Sign in to follow this  
vhortex

How To Delete File Using PHP Shell Script

Recommended Posts

i have this problem regarding file accessseems 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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 filein file get the name by run coomend, give chmod 777 and rm itGET for shell run commend is$1 for firste.g"delete.now" :chmod 777 $1 &rm $1"run.php" :<?php$file="file.name";system("./delete.now ".$file);?>i hope that helpsNoMore

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.