• Resolved dr

    (@daniel_richard)


    Latest update causing errors.

    Undefined index: SCRIPT_URI
    wp-content/plugins/litespeed-cache/src/router.cls.php:657

Viewing 11 replies - 1 through 11 (of 11 total)
  • 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 doesn’t 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 ;
    		}
    
    	}
    

    If you don’t want to edit code, just replace the whole router.cls.php file with this: https://pastebin.com/gtbbJ006

    • This reply was modified 4 years, 6 months ago by needforbeans.
    Plugin Support Hai Zheng?

    (@hailite)

    This is fixed in v3.1-rc1. Will be included in next release.

    Hello. I have the same error.

    Undefined index: SCRIPT_URI

    View post on imgur.com

    • This reply was modified 4 years, 6 months ago by samtulana.
    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    @samtulana yes , it’s fixed in next release.

    Best regards,

    Thank you very much. I’ll be waiting.

    Thread Starter dr

    (@daniel_richard)

    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?

    I’am already update plugin to 3.1 ver and copy code form @needforbeans but it’s 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

    • This reply was modified 4 years, 6 months ago by Kamfret Crew.
    Plugin Support Hai Zheng?

    (@hailite)

    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

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Undefined index: SCRIPT_URI’ is closed to new replies.