Wordpress LScache Plugin: Undefined index: SCRIPT_URI
Last Updated on: Wed, 15 Apr 2026 00:00:02 Latest update causing errors. Undefined index: SCRIPT_URI wp-content/plugins/litespeed-cache/src/router.cls.php:657 Notice: Undefined index: SCRIPT_URI in /wpcontent/plugins/litespeedcache/src/router.cls.php on line 657 /wp-content/plugins/litespeed-cache/src/router.cls.php on line 657 same here The error comes up because the server doesnt even have a SCRIPT_URI index in the array. You can solve the error by replacing the serve_static function in the file router.cls.php with this: public static function serve_static() if( array_key_exists(SCRIPT_URI, $_SERVER)) if ( strpos( $_SERVER[ SCRIPT_URI ], LITESPEED_STATIC_URL . / ) !== 0 ) return $path = substr( $_SERVER[ SCRIPT_URI ], strlen( LITESPEED_STATIC_URL . / ) ) $path = explode( /, $path, 2 ) if ( empty( $path[ 0 ] ) || empty( $path[ 1 ] ) ) return switch ( $path[ 0 ] ) case avatar : Avatar::get_instance()->serve_satic( $path[ 1 ] ) break case cssjs : Optimize::get_instance()->serve_satic( $path[ 1 ] ) break default : break Expand If you dont want to edit code, just replace the whole router.cls.php file with this: https://pastebin.com/gtbbJ006 This is fixed in v3.1-rc1. Will be included in next release. Hello. I have the same error. Undefined index: SCRIPT_URI https://i.imgur.com/GolIHmN.png Hi, @samtulana yes , its fixed in next release. Best regards, Thank you very much. Ill be waiting. Marking as resolved as: ? needforbeans have provided a quick copy-and-paste patch as a current solution ? hai and qtwrk have assured us about the fix in the next release Thanks for your help all! Hi how to solved this? Iam already update plugin to 3.1 ver and copy code form @needforbeans but its still error. wp-content/plugins/litespeed-cache/src/router.cls.php on line 657 #EDITED Already fixed, dunno why but if cache empty the notice will show That error was logged before you upgraded to v3.1. You can safely clear or ignore it. After cleared, you will not see it anymore as you are using v3.1 now. @hailite okay already fix, thanks anyway
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference