Wordpress LScache Plugin: PHP 8.0 Bug
Last Updated on: Wed, 15 Apr 2026 00:00:02 When switching openlitespeed to use lsphp80 after clearing all caches the following error message starts to show in debug mode (Testing sites are compatible). Fatal error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in /home/sitename/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php:223 Stack trace: #0 /home/sitename/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php(223): strpos() #1 /home/sitename/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php(764): LiteSpeed Optimize->remove_query_strings() #2 /home/sitename/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php(400): LiteSpeed Optimize->_build_hash_url() #3 /home/sitename/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php(300): LiteSpeed Optimize->_optimize() #4 /home/sitename/public_html/wp-content/plugins/litespeed-cache/src/core.cls.php(395): LiteSpeed Optimize::finalize() #5 [internal function]: LiteSpeed Core->send_headers_force() #6 /home/sitename/public_html/wp-includes/functions.php(4757): ob_end_flush() #7 /home/sitename/public_html/wp-includes/class-wp-hook.php(292): wp_ob_end_flush_all() #8 /home/sitename/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #9 /home/sitename/public_html/wp-includes/plugin.php(484): WP_Hook->do_action() #10 /home/sitename/public_html/wp-includes/load.php(1072): do_action() #11 [internal function]: shutdown_action_hook() #12 main thrown in /home/sitename/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 223 Hi, if you are revert to 7.4 or lower , this error will be gone ? Best regards, Hi, Im going to mark this topic Resolved , due to lack of activity. If you still need help, please feel free to re-open it. When re-open it, please also change the topic status to not solved Best regards, Downgrading to 7.4 does remove the error but PHP 7.4 reaches EOL FOR ACTIVE SUPPORT in 3 months leaving only security updates after that. whats your WP version ? does this mean that the plugin should only use php 7.4 and should not be upgraded to php 8? Seems to be working now, only difference I can see is the WordPress Version auto updated. @ductm seems to work now on PHP 8.0 im on php 8.0, when i saw this thread saying that downgrading to php 7.4 there should be no error Should I continue to use php 8.0 or downgrade to 7.4? i just want to know is this plugin currently fully compatible with php 8.0? on my test WP 5.8 + LSCWP v3.6.4 + cPanel ea-php80 , it works it could be error from other non-php8.0-compatible plugin/theme or even wordpress itself it you were on previous version
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference