If a call to unlink() returns false for the specified path, how do you find out what the reason for the failure was (i.e. EISDIR, ENOENT, ELOOP etc.)? PHP 5.x running on redhat
here's one way
unlink("/path/that/does/not/exist"); print_r(error_get_last());
See Error handling for more details