• Resolved nicmare

    (@nicmare)


    [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…

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support qtwrk

    (@qtwrk)

    please try manually remove /wp-content/litespeed/js/ then do a purge all , then see if this log still generates

    Thread Starter nicmare

    (@nicmare)

    i did that now. lets see whats happening…?thanks

    Thread Starter nicmare

    (@nicmare)

    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

    Plugin Support qtwrk

    (@qtwrk)

    please check and post what’s ownership and permissions of files inside of /home/…/public_html/wp-content/litespeed/js/ when this error happens

    Thread Starter nicmare

    (@nicmare)

    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

    Plugin Support qtwrk

    (@qtwrk)

    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

    Thread Starter nicmare

    (@nicmare)

    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:
    image

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PHP Warning: rmdir’ is closed to new replies.