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:
This works perfectly and returns:
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?