LiteSpeed Cache - Community

LiteSpeed Cache - Community 1.0.4.3

No permission to download
Error after install with PHP 7.0.7/lsws and Litespeedtech Enterprise with "Verify setup"

Code:
array_diff(): Argument #2 is not an array

XenForo_Application::handlePhpError()
array_diff() in Litespeedcache/ControllerAdmin/Manage.php at line 96
Litespeedcache_ControllerAdmin_Manage->verifySetup() in Litespeedcache/ControllerAdmin/Manage.php at line 127
Litespeedcache_ControllerAdmin_Manage->parseActions() in Litespeedcache/ControllerAdmin/Manage.php at line 41
Litespeedcache_ControllerAdmin_Manage->actionActions() in XenForo/FrontController.php at line 351
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
XenForo_FrontController->run() in /home/wf/public_html/admin.php at line 13

Getting the same error. Site and cache still seem to work, but the verify settings function does not.

My deepest apologies. To fix this problem, in the file:
library/Litespeedcache/ControllerAdmin/Manage.php
Around line 70ish:

Code:
        if ($serverVary) {
            $serverVary = explode(',', $serverVary);
        }
        $styles = $this->getModelFromCache('XenForo_Model_Style')
            ->getAllStylesAsFlattenedTree();

should be replaced with:

Code:
        if ($serverVary) {
            $serverVary = explode(',', $serverVary);
        }
        else {
            $serverVary = array();
        }
        $styles = $this->getModelFromCache('XenForo_Model_Style')
            ->getAllStylesAsFlattenedTree();
 
Hi,
After updating to the latest version (1.0.3.1) I have this error in one of my websites :
Code:
ErrorException: Fatal Error: Can't use function return value in write context - library/Litespeedcache/ControllerAdmin/Manage.php:96

Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}


array(3) {
  ["url"] => string(39) "https://domain.com/admin.php?lscache/"
  ["_GET"] => array(1) {
    ["lscache/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}


Any help would be appreciated.
 
Hi,
After updating to the latest version (1.0.3.1) I have this error in one of my websites :
Code:
ErrorException: Fatal Error: Can't use function return value in write context - library/Litespeedcache/ControllerAdmin/Manage.php:96

Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}


array(3) {
  ["url"] => string(39) "https://domain.com/admin.php?lscache/"
  ["_GET"] => array(1) {
    ["lscache/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}


Any help would be appreciated.

In that file (library/Litespeedcache/ControllerAdmin/Manage.php) at line 96, you should see:

Code:
if ((empty($search)) || (empty(array_diff($search, $serverVary)))) {

Replace that with:

Code:
        $diff = array_diff($search, $serverVary);
        if ((empty($search)) || (empty($diff))) {

Essentially: set array_diff to a variable first, and use the variable in the empty check.

From my research, it looks like this is an issue for PHP versions less than 5.5. Thank you for bringing this to our attention.

Let me know if it works,
Kevin
 
My pleasure,

I have php selector installed on the server so I can change the php version...

thank you for the reply.
 
There is nothing within the Web Server nor the plugin that would interfere with the AMP project's code.

I guess it depends on how AMP resources are served? If it goes back to the server and requests a js page, it's likely not going to help much to cache the js page because it's a static file.

I don't fully understand the AMP project, so if there's a piece of it that could be improved via caching, I'd be more than happy to add it if it's not going to require a lot of changes.
 
I'm getting this error when I click Litespeed cache management in admin panel ;

Fatal error: Can't use function return value in write context in /home/username/public_html/forums/library/Litespeedcache/ControllerAdmin/Manage.php on line 96
 
Hello again,

Second error ;
ErrorException: Undefined index: litespeedcacheXF_logincookie - library/Litespeedcache/Listener/Global.php:533

Thank you
 
Hi Ugur,

In that file, around that line, there is an "elseif" code block.

Please replace that with:
Code:
                elseif (($noPrefix == 'Admin_Option')
                    && ($action == 'Save')) {
                    $options = $controller->getInput()->filterSingle('options',
                            XenForo_Input::ARRAY_SIMPLE);
                    if ((!empty($options))
                        && (isset($options['litespeedcacheXF_logincookie']))) {
                        self::varyCmp($controllerResponse->redirectParams,
                            $controller->getRequest()
                                ->getServer(self::COOKIE_LSCACHE_VARY_NAME),
                            $options['litespeedcacheXF_logincookie']
                        );
                    }
                }

Let me know how it goes,
Kevin
 
Hi Ugur,

In that file, around that line, there is an "elseif" code block.

Please replace that with:
Code:
                elseif (($noPrefix == 'Admin_Option')
                    && ($action == 'Save')) {
                    $options = $controller->getInput()->filterSingle('options',
                            XenForo_Input::ARRAY_SIMPLE);
                    if ((!empty($options))
                        && (isset($options['litespeedcacheXF_logincookie']))) {
                        self::varyCmp($controllerResponse->redirectParams,
                            $controller->getRequest()
                                ->getServer(self::COOKIE_LSCACHE_VARY_NAME),
                            $options['litespeedcacheXF_logincookie']
                        );
                    }
                }

Let me know how it goes,
Kevin

Thank you again , It looks fine now.
 
Hello @Michael A., I have the following error :

Notice: LiteSpeed Web Server with LSCache module was not detected. This plugin will NOT work.

Here are my .htaccess rules :

Code:
<IfModule litespeed>
       CacheLookup public on
       CacheEnable public /

        RewriteEngine On
        RewriteCond %{HTTP_COOKIE} !skipPageCache
        RewriteRule .* - [L,E=cache-control:max-age=120]
</IfModule>


I tried with that too :
Code:
<IfModule LiteSpeed>
 
Top Bottom