Wordpress LScache Plugin: Plugin activation not possible on Local by Flywheel (nginx)
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi, I have our Live-Site hosted on a Litespeed-Server. My Dev enviroment is set up with Local by Flywheel (nginx, MySQL, PHP 7.4.1) on a Windows 10 machine. Unfortunately its not possible, to activate the LiteSpeed Cache plugin here. The installation works without a problem, but the activation ends with an fatal: PHP Fatal error: Maximum execution time of 1200 seconds exceeded in C: Users ecc Local Sites he-dev-site app public wp-content plugins litespeed-cache src htaccess.cls.php on line 197 The config of the LOCAL server: nginx/1.16.0 PHP 7.4.1 SSL is enabled Windows 10 Local 5.4.1 This topic was modified 2 years, 6 months ago by camya. Hi, The error occurs due to this line of code if ( $start_path === / || ! $start_path ) as it was not meant/designed for Windows file system , so when activates , it stuck on loop for searching htaccess on a non-existing path for Windows system. not sure if there is a quick fix, but please try change that line to if ( $start_path === C: || ! $start_path ) and see how it goes. Best regards, Hi qtwrk, I found a bug in the _htaccess_search() method which could be fixed using wp_normalize_path(). After this fix, the plugin works on Windows systems. The _htaccess_search() function in LiteSpeed Cache tests, if the $star_path equals the $_SERVER[ DOCUMENT_ROOT ]. Unfortunately the path separators are different for both paths on Windows systems. (Backslashes vs Slashes). The fix is to use the WordPress function wp_normalize_path(). This will normalize the paths and the condition will match. Code on Github (_htaccess_search() ? Line 194) wp_normalize_path() modification: // 2020-05-15 - CAMYA - Normalize start_path and DOCUMENT_ROOT (Windows fix) if ( ! empty( $_SERVER[ DOCUMENT_ROOT ] ) && wp_normalize_path($start_path) === wp_normalize_path($_SERVER[ DOCUMENT_ROOT ]) ) return false Another problem is the root folder, if $_SERVER[ DOCUMENT_ROOT ] is not set. I guess, the function is also used from the WP-CLI. (Havent checked this by now). My fix is to store the previous folder into a variable and check, if we reached the root folder. (old folder === new folder) Here the complete modification: private function _htaccess_search( $start_path ) while ( ! file_exists( $start_path . /.htaccess ) ) if ( $start_path === / || ! $start_path) return false // 2020-05-15 - CAMYA - Normalize start_path and DOCUMENT_ROOT (Windows fix) if ( ! empty( $_SERVER[ DOCUMENT_ROOT ] ) && wp_normalize_path($start_path) === wp_normalize_path($_SERVER[ DOCUMENT_ROOT ]) ) return false // 2020-05-15 - CAMYA - Set filesystem root check helper variable (Windows fix) if (!isset($start_path_before)) $start_path_before = $start_path $start_path = dirname( $start_path ) // 2020-05-15 - CAMYA - Is this the filesystem root folder? (Windows fix) if ($start_path_before === $start_path) return false // 2020-05-15 - CAMYA - Update path (Windows fix) $start_path_before = $start_path return $start_path Expand I hope, its possible to add the wp_normalize_path() in the near future, because this will make the plugin work for many more people. Best, Andreas Fixed in 3.1-rc3. Great thanks! Hi Hai, Great that you fixed it so rapidly. I just tested it and the activation of the Plugin now works also on Windows 10 / nginx / Local By Flywheel. Nice work. Thank you.
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference