Possible bug in lists/admin/index.php line 712

During manual installation I always get the following error:
“The pageroot in your config “/lists” does not match the current location”
I looked for the file containing the error text and I found in lists/admin/index.php at line 712, the following:
if (WARN_ABOUT_PHP_SETTINGS && !$GLOBALS[‘commandline’]) {
if (strpos(getenv(‘REQUEST_URI’), $pageroot.’/admin’) !== 0) {
Warn(s(
‘The pageroot in your config “%s” does not match the current location “%s”. Check your config file.’,
$pageroot,
strstr(getenv(‘REQUEST_URI’), ‘/admin’, true)
));
}
}
taking in consideration the description of the function strpos:
strpos — Find the position of the first occurrence of a substring in a string
strpos(string $haystack, string $needle, int $offset = 0): int|false

as a consequence the following line is not correct:
if (strpos(getenv(‘REQUEST_URI’), $pageroot.’/admin’) !== 0) {

should be the following:
if (strpos(getenv(‘REQUEST_URI’), $pageroot.’/admin’) !== FALSE) {

Do you agree?

@Oreste That code is checking whether the current URL starts with e.g. mysite.com/admin not simply whether the URL contains that string.

If you are getting this warning message then check the value of $pageroot in the config.php file.

Thanks @duncanc for your quick reply. Actually it happens that I modified the vaue of $pageroot in config_extended.php because config.php does not contain that variable, in any possible way, but no success at all. I am trying to instal phplist in a server ubuntu 22, Apache, localhost.

@Oreste You need to add the setting to config.php. See this explanation at the start of that file

** NOTE: To use options from config_extended.php, you need to copy them to this file **

My mistake, did it, it works, thanks