Title: PHP 8.0 Bug
Last modified: July 20, 2021

---

# PHP 8.0 Bug

 *  Resolved [entrepreneuraj](https://wordpress.org/support/users/entrepreneuraj/)
 * (@entrepreneuraj)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/php-8-0-bug/)
 * 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`

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14682384)
 * Hi,
 * if you are revert to 7.4 or lower , this error will be gone ?
 * Best regards,
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14708087)
 * Hi,
 * I’m 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,
 *  Thread Starter [entrepreneuraj](https://wordpress.org/support/users/entrepreneuraj/)
 * (@entrepreneuraj)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14710647)
 * 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.
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14710817)
 * what’s your WP version ?
 *  [ductm](https://wordpress.org/support/users/ductm/)
 * (@ductm)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14711463)
 * does this mean that the plugin should only use php 7.4 and should not be upgraded
   to php 8?
 *  Thread Starter [entrepreneuraj](https://wordpress.org/support/users/entrepreneuraj/)
 * (@entrepreneuraj)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14711472)
 * Seems to be working now, only difference I can see is the WordPress Version auto
   updated. [@ductm](https://wordpress.org/support/users/ductm/) seems to work now
   on PHP 8.0
 *  [ductm](https://wordpress.org/support/users/ductm/)
 * (@ductm)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14711543)
 * i’m 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?
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14712020)
 * 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

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘PHP 8.0 Bug’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

## Tags

 * [fatal](https://wordpress.org/support/topic-tag/fatal/)

 * 8 replies
 * 3 participants
 * Last reply from: [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/php-8-0-bug/#post-14712020)
 * Status: resolved