PHP Warning in optimize.cls.php
-
Hi,
I’m running litespeed cache v3.5.2 and I’ve got these warnings in litespeed-toolbox#log_viewer :
PHP Warning: strpos() expects parameter 1 to be string, array given in wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 231
PHP Warning: strpos() expects parameter 1 to be string, array given in wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227
EDIT : Also got this notice : Array to string conversion in wp-content/plugins/litespeed-cache/src/css.cls.php on line 390
Have a nice day !
-
This topic was modified 5 years, 3 months ago by
nir0ma.
-
This topic was modified 5 years, 3 months ago by
-
Hi,
Same issue here.
[05-Nov-2020 07:38:42 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227
[05-Nov-2020 07:38:42 Europe/Bucharest] PHP Warning: strpos() expects parameter 1 to be string, array given in /wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 231THanks
Are you able to reproduce it?
Hi, Same issue here… (WP:5.5.3 PHP:7.4)
[09-Nov-2020 10:56:20 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/site/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php on line 707
[09-Nov-2020 10:56:20 UTC] PHP Warning: parse_url() expects parameter 1 to be string, array given in /home/site/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 388
[09-Nov-2020 10:56:20 UTC] PHP Warning: substr() expects parameter 1 to be string, array given in /home/site/public_html/wp-content/plugins/litespeed-cache/src/css.cls.php on line 391Hi,
could you please edit this file
/home/site/public_html/wp-content/plugins/litespeed-cache/src/utility.cls.php
on line 707, you will see
$url_parsed = parse_url( $url );
please add this line ABOVE it
error_log($url,3,”/home/site/public_html/lscwp.log”);
then reproduce that error , and see what content is logged into lscwp.log ?
Best regards,
Hi,
Here is the log :https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.js https://domain.com/wp-content/themes/themename/custom.js https://c0.wp.com/p/jetpack/9.0.2/_inc/build/photon/photon.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/wp-embed.min.js https://c0.wp.com/c/5.5.3/wp-includes/js/comment-reply.min.jsHi,
well , sorry , the log is bit of mess and hard to determinate which round was it
please change
error_log($url,3,"/home/site/public_html/lscwp.log");to
error_log("start\n",3,"/home/site/public_html/lscwp.log"); error_log($url,3,"/home/site/public_html/lscwp.log"); error_log("\nend",3,"/home/site/public_html/lscwp.log");clean up current lscwp.log file and repeat the process
Best regards,
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.
Best regards,
I’ve got the same errors being logged over and over too:
[29-Nov-2020 12:30:24 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/website/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 [29-Nov-2020 12:30:24 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/website/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 227 [29-Nov-2020 12:30:24 UTC] PHP Warning: strpos() expects parameter 1 to be string, array given in /home/website/public_html/wp-content/plugins/litespeed-cache/src/optimize.cls.php on line 231Running PHP v7.4, WP v5.5.3 & LiteSpeed Cache v3.5.2
Same error here
The topic ‘PHP Warning in optimize.cls.php’ is closed to new replies.