Wordpress LScache Plugin: PHP Warning: rmdir
Last Updated on: Wed, 15 Apr 2026 00:00:02 [20-May-2022 07:52:45 UTC] PHP Warning: rmdir(/home/?/public_html/wp-content/litespeed/js/): Directory not empty in /home/?/public_html/wp-content/plugins/litespeed-cache/src/file.cls.php on line 43 with latest WP and LSCache my debug.log gets flooded with these warnings? please try manually remove /wp-content/litespeed/js/ then do a purge all , then see if this log still generates i did that now. lets see whats happening??thanks warning persists: PHP Warning: rmdir(/home/?/public_html/wp-content/litespeed/js/): Directory not empty in /home/?/public_html/wp-content/plugins/litespeed-cache/src/file.cls.php on line 43 please check and post whats ownership and permissions of files inside of /home/?/public_html/wp-content/litespeed/js/ when this error happens this is no issue of ownership nor permissions. i have no similar issues at all. and as the warning says, the plugin tries to remove the folder but it needs to be emptied first. see more at https://stackoverflow.com/questions/1653771/how-do-i-remove-a-directory-that-is-not-empty yes , I know it needs to be emptied first if you check the source code where you get the error, you will see $files = array_diff( scandir( $dir ), array( ., .. ) ) foreach ( $files as $file ) is_dir( $dir/$file ) ? self::rrmdir( $dir/$file ) : unlink( $dir/$file ) return rmdir( $dir ) it loops through all the files and remove them first, and then do rmdir so this looks something wrong when it tries to remove the file please check what are the ownership and permissions on the remaining files after you see this error , and also please verify what is the user your PHP process runs on i can see that the /js/ folder was (re)created today. that means basically the deletion of it works most of the time. but sometimes not: and i get the warning only for the /js/ folder ? never got it regarding the /css/ folder. in both cases the owner is the same like of every other file everywhere. and chmod is 755.
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference