I have a PHP file “install.php” which handles the installation of other scripts. I want this file to delete itself and its containing folder after it has been run.
Is this possible?
A demo given that the folder only contains your install.php:
mkdir demo cd demo echo "<?php unlink(__FILE__); rmdir(__DIR__); " > install.php php install.php cd .. ls
ls doesn’t show the “demo dir” any more.
The recursive deletion shouldn’t be that hard to figure out ether if there are more (sub-)folders you want to remove.