Hi @greencode
Could you check the permissions for the .htaccess file? Sometimes, the permissions may be altered such that the file is not writable for security reasons. In these situations, we cannot write to the file.
Hi @greencode
If you don’t mind modifying code, we have a fix for the issue.
In the file wp-content/plugins/litespeed-cache/admin/class-litespeed-cache-admin-rules.php:
The modifications need to be made to the path_set function ~ line 224
$install = ABSPATH;
$access = get_home_path();
Needs to be replaced with:
$real = trailingslashit(realpath(ABSPATH));
$install = $real;
$access = trailingslashit(realpath(get_home_path()));
And later,
else {
// they are equal - no need to find paths.
$this->home_path = ABSPATH . '.htaccess';
$this->site_path = ABSPATH . '.htaccess';
return;
}
$common_path = substr(ABSPATH, 0, -(strlen($install_part) + 1));
Should be replaced with:
else {
// they are equal - no need to find paths.
$this->home_path = $real . '.htaccess';
$this->site_path = $real . '.htaccess';
return;
}
$common_path = substr($real, 0, -(strlen($install_part) + 1));
After that, the error should no longer occur.
Let us know if you have any questions about this!
Kevin
Thanks for this. No need though. You’ve already fixed it on my site via UK Dedicated (GURU) who got in touch with you about this issue.
Glad to hear it, let us know if you run into any more issues!
Cheers,
Kevin
I am looking through this file you mention but the lines you mention arenot in the file, i have searched the file and cant find:
$install = ABSPATH;
$access = get_home_path();
What am i doing wrong, at line 224 i find:
}
else {
$common_path = rtrim($common_path, ‘/’);
}
Hi @hampmir
This issue should have been resolved with the latest releases. What version are you using and what problems are you experiencing?
Cheers,
Kevin
I just updated the plugin so i am using the latest version. I am also using the latest version of WordPress so i guess it isn’t totally fixed :/
I have described my issues in a seperate thread so i dont hijack this one đŸ™‚
https://wordpress.org/support/topic/fatal-error-when-activating-46/