• Resolved jendeh

    (@jendeh)


    Hi, I am getting this php error. (I am on a litespeed host and not using any other caching plugin).

    PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, bool given in /home/v..mv/public_html/wp-content/advanced-cache.php:258
    Stack trace:

    0 /home/v..mv/public_html/wp-content/advanced-cache.php(219): swcfpc_fallback_cache_remove_url_parameters()

    1 /home/v..mv/public_html/wp-content/advanced-cache.php(14): swcfpc_fallback_cache_get_current_page_cache_key()

    2 /home/v..mv/public_html/wp-settings.php(95): include(‘/home/v..mv/pu…’)

    3 /home/v..mv/public_html/wp-config.php(108): require_once(‘/home/v..mv/pu…’)

    4 /home/v..mv/public_html/wp-load.php(50): require_once(‘/home/v..mv/pu…’)

    5 /home/v..mv/public_html/wp-blog-header.php(13): require_once(‘/home/v..mv/pu…’)

    6 /home/v..mv/public_html/index.php(17): require(‘/home/v..mv/pu…’)

    7 {main}

    thrown in /home/v..mv/public_html/wp-content/advanced-cache.php on line 258

    The headers looks fine and caching works, cloudflare is usually HIT. Any suggestions, what should I do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @jendeh,
    Seems wired. Cause it seems that the URL that is being accessed is a wrong URL as the PHP parse_url() function is not able to parse it. You can also try disabling the page cache from the plugin settings and reenabling it to see if it fixes. Otherwise if you know for which URL that issue is happening, please share the URL.

    Thread Starter jendeh

    (@jendeh)

    Thank you so much for your reply. It is not denoting any specific url. This is what is at 258 line in advanced cache file

    if( array_key_exists( 'query', $url_parsed ) ) {
    
            if( $url_parsed[ 'query' ] === '' ) {
    
                // this means the URL ends with just ? i.e. /example-page/? - so just remove the last character ? from the URL
    
                $url = substr( trim( $url ), 0, -1 );
    
            } else {
    
                // Set the ignored query param array
    
                $ignored_query_params = [
    
                    'Browser',
    
                    'C',
    
                    'GCCON',
    
                    'MCMP',
    
                    'MarketPlace',
    
                    'PD',

    The error appeared once yesterday, haven’t seen it again.

    The headers look fine.

    • This reply was modified 3 years, 1 month ago by jendeh.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi @jendeh,
    I have already checked the code before replying you. But the thing is $url_parsed should always be an Array after parse_url() is executed. So, this error should never happen.

    It might be possible that some bot tried to access the site with some malformed URL which caused this issue, I think you can safely ignore it.

    Thread Starter jendeh

    (@jendeh)

    Got it, thank you so much!!

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

The topic ‘Php error’ is closed to new replies.