Results 1 to 5 of 5
May 5, 2009, 03:50 #1
- Join Date
- Feb 2008
- 0 Post(s)
- 0 Thread(s)
Removing files using bash commands in PHP Script
I am trying to find a way to remove files that have been stored on my server through my PHP script.
I am able to use the list successfully but the removal of the files is not working.
For testing purposes I created a small PHP script to test the Bash command execution. The code I used is as follows:
echo exec('ls /var/www/'.escapeshellarg($name).'/kind*');
If I replace the 'ls' with 'rm' (or any derivative thereof) absolutely nothing happens.
I have also tried using the 'system' command.
Can anyone suggest a way of removing the files?