Title: Litespeed Cache PHP warnings
Last modified: January 2, 2021

---

# Litespeed Cache PHP warnings

 *  Resolved [WriterCJ](https://wordpress.org/support/users/calvin141170/)
 * (@calvin141170)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/)
 * Hi,
 * Noticing a lot of PHP warnings generated by Litespeed Cache in the Error Logs
   generated by the BPS Pro Security Plugin — here’s a sample from the log on 30
   December.
 * [BPS Pro htaccess Protected Secure PHP Error Log]
 * [30-Dec-2020 14:22:19 UTC] PHP Warning: strpos() expects parameter 1 to be string,
   array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-
   cache/src/optimize.cls.php on line 228
    [30-Dec-2020 14:22:19 UTC] PHP Warning:
   strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.
   com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line
   232 [30-Dec-2020 14:22:19 UTC] PHP Warning: parse_url() expects parameter 1 to
   be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/
   litespeed-cache/src/utility.cls.php on line 707 [30-Dec-2020 14:22:19 UTC] PHP
   Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.
   com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 388[
   30-Dec-2020 14:22:19 UTC] PHP Warning: substr() expects parameter 1 to be string,
   array given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-
   cache/src/css.cls.php on line 391 [30-Dec-2020 14:22:19 UTC] PHP Warning: parse_url()
   expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/
   wp-includes/class-http.php on line 272 [30-Dec-2020 14:22:30 UTC] PHP Warning:
   strpos() expects parameter 1 to be string, array given in /home/irelandswildlife.
   com/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line
   228 [30-Dec-2020 14:22:30 UTC] PHP Warning: strpos() expects parameter 1 to be
   string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/
   litespeed-cache/src/optimize.cls.php on line 232 [30-Dec-2020 14:22:30 UTC] PHP
   Warning: parse_url() expects parameter 1 to be string, array given in /home/irelandswildlife.
   com/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php on line
   707 [30-Dec-2020 14:22:30 UTC] PHP Warning: parse_url() expects parameter 1 to
   be string, array given in /home/irelandswildlife.com/public_html/wp-content/plugins/
   litespeed-cache/src/css.cls.php on line 388 [30-Dec-2020 14:22:30 UTC] PHP Warning:
   substr() expects parameter 1 to be string, array given in /home/irelandswildlife.
   com/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 391[
   30-Dec-2020 14:22:30 UTC] PHP Warning: parse_url() expects parameter 1 to be 
   string, array given in /home/irelandswildlife.com/public_html/wp-includes/class-
   http.php on line 272 [30-Dec-2020 14:22:57 UTC] PHP Warning: strpos() expects
   parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/
   wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 228 [30-Dec-2020
   14:22:57 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given
   in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-cache/
   src/optimize.cls.php on line 232 [30-Dec-2020 14:22:57 UTC] PHP Warning: parse_url()
   expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/
   wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707 [30-Dec-2020
   14:22:57 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array
   given in /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-
   cache/src/css.cls.php on line 388 [30-Dec-2020 14:22:57 UTC] PHP Warning: substr()
   expects parameter 1 to be string, array given in /home/irelandswildlife.com/public_html/
   wp-content/plugins/litespeed-cache/src/css.cls.php on line 391
 * Everything seems to be working properly, but would still rather not see these
   errors.
 * Thanks

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

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/#post-13857114)
 * Hi,
 * please try this :
 * edit file /home/irelandswildlife.com/public_html/wp-content/plugins/litespeed-
   cache/src/optimize.cls.php on line 229-232 , you will see a block
 *     ```
       		$basename = basename( $filename );
       		if ( preg_match( '|[-\.]min\.(?:[a-zA-Z]+)$|i', $basename ) ) {
       			return true;
       		}
       ```
   
 * change it to
 *     ```
       error_log("\nstart-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
       error_log($filename,"3","/home/irelandswildlife.com/public_html/lscwp.log");
       error_log("\nend-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
       		$basename = basename( $filename );
       		if ( preg_match( '|[-\.]min\.(?:[a-zA-Z]+)$|i', $basename ) ) {
       			return true;
       		}
       ```
   
 * then when that error happens again , post the content of /home/irelandswildlife.
   com/public_html/lscwp.log
 * Best regards,
    -  This reply was modified 5 years, 5 months ago by [qtwrk](https://wordpress.org/support/users/qtwrk/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/#post-13859374)
 * no , sorry , my bad , please edit that file
 * change line 228-230
 *     ```
       		if ( strpos( $src, '_litespeed_rm_qs=0' ) || strpos( $src, '/recaptcha' ) ) {
       			return $src;
       		}
       ```
   
 * to
 *     ```
       error_log("\nstart-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
       error_log($src,"3","/home/irelandswildlife.com/public_html/lscwp.log");
       error_log("\nend-mark\n","3","/home/irelandswildlife.com/public_html/lscwp.log");
   
       		if ( strpos( $src, '_litespeed_rm_qs=0' ) || strpos( $src, '/recaptcha' ) ) {
       			return $src;
       		}
       ```
   
 *  [florinb1](https://wordpress.org/support/users/aventurescu/)
 * (@aventurescu)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/#post-13888135)
 * Hi, qtwrk,
 * I can confirm above errors, as Calvin mentioned.
 * I tried the above tweaks that you shown and did not worked. Same errors. Any 
   ideas?
 * Thanks,
    Florin
 * [10-Jan-2021 16:01:57 Europe/Bucharest] PHP Warning: strpos() expects parameter
   1 to be stri[10-Jan-2021 16:01:57 Europe/Bucharest] PHP Warning: strpos() expects
   parameter 1 to be string, array given in /home/avent/public_html/wp-content/plugins/
   litespeed-cache/src/optimize.cls.php on line 228
    [10-Jan-2021 16:01:57 Europe/
   Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given
   in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.
   php on line 228 [10-Jan-2021 16:01:57 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 232 [10-Jan-2021 16:03:02
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 228 [10-Jan-2021 16:03:02 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 228 [10-Jan-2021 16:03:02
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 232 [10-Jan-2021 16:03:09 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 228 [10-Jan-2021 16:03:09
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 228 [10-Jan-2021 16:03:09 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 232 [10-Jan-2021 16:03:14
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 228 [10-Jan-2021 16:03:14 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 228 [10-Jan-2021 16:03:14
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 232 [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 228 [10-Jan-2021 16:03:25
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 228 [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 232 [10-Jan-2021 16:03:25
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 228 [10-Jan-2021 16:03:25 Europe/Bucharest] PHP Warning: strpos()
   expects parameter 1 to be string, array given in /home/avent/public_html/wp-content/
   plugins/litespeed-cache/src/optimize.cls.php on line 228 [10-Jan-2021 16:03:25
   Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array
   given in /home/avent/public_html/wp-content/plugins/litespeed-cache/src/optimize.
   cls.php on line 232
    -  This reply was modified 5 years, 5 months ago by [florinb1](https://wordpress.org/support/users/aventurescu/).
    -  This reply was modified 5 years, 5 months ago by [florinb1](https://wordpress.org/support/users/aventurescu/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/#post-13888610)
 * Hi,
 * [@aventurescu](https://wordpress.org/support/users/aventurescu/)
 * that is not a fix, but a code to log out more information for us to analyze
 * and I would like to ask you to create your own topic for your issue 🙂
 * Best regards,
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/#post-13919759)
 * 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,
 *  [sumoboy](https://wordpress.org/support/users/sumoboy/)
 * (@sumoboy)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/#post-13929988)
 * I ran into the same issue, added the debug code as mentioned with output below.
   The temporary fix was disabling Page Optimization -> JS Settings -> JS Combine
   which suppressed the error messages, looks the last log entry was empty which
   I’d suspect is the generating the error.
    ————-
 * start-mark
    [https://www.xyz.com/wp-includes/js/wp-embed.min.js?ver=5.6](https://www.xyz.com/wp-includes/js/wp-embed.min.js?ver=5.6)
   end-mark
 * start-mark
    [https://www.xyz.com/wp-content/plugins/facetwp/assets/js/dist/front.min.js?ver=3.7.1](https://www.xyz.com/wp-content/plugins/facetwp/assets/js/dist/front.min.js?ver=3.7.1)
   end-mark
 * start-mark
    [https://www.xyz.com/wp-content/plugins/facetwp-submit/facetwp-submit.js?ver=3.7.1](https://www.xyz.com/wp-content/plugins/facetwp-submit/facetwp-submit.js?ver=3.7.1)
   end-mark
 * start-mark
 * end-mark

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

The topic ‘Litespeed Cache PHP warnings’ 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/)

 * 6 replies
 * 4 participants
 * Last reply from: [sumoboy](https://wordpress.org/support/users/sumoboy/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/litespeed-cache-php-warnings/#post-13929988)
 * Status: resolved