Pageroot problem

I have been trying to get a fresh install of phplist to work. I have read the documentation and forum but nothing seems to work. I have edited the config.php and tried all combinations I can imagine to get it right but still i get this stupid error;

The pageroot in your config “NAN” does not match the current location “”. Check your config file.

At one point it said;

The pageroot in your config “” does not match the current location “”. Check your config file.

I am using the newest version of the software, is there any way to get this to work or does phplist simply not function correctly on some hosts? I have php version 7.3 i believe. The database and everything else seems to be working just fine.

@sortebill the explanation in config_extended should help you but you shouldn’t need to do anything if you have installed phplist in the default location which is ‘/lists’.

// if you change the path to the phpList system, make the change here as well
// path should be relative to the root directory of your webserver (document root)
// If you install phpList in the document root then the value should be an empty string, not '/'.
// Warning: Do not change this after installation. You can only change this before you
// install and initialise phpList.
$pageroot = '/lists';

I did that and the problem persists. As I explained initially, I have followed all advice and instructions I could find on the web. I have installed in default location and not changed the name of the folder.

@sortebill If you remove any addition that you made to config.php for pageroot, then please show the error message that is displayed.

Also confirm the URL that you are using to access phplist, and show the web server file system path to phplist (e.g. /home/xxx/public_html … if you are using Cpanel).

Hey, the path to my installation is ;

“/www/lists”

When removed the pageroot part from config it has this error;

The pageroot in your config “/lists” does not match the current location “”. Check your config file.

@duncanc Do you have any idea what the reason for this strange problem might be?

@sortebill I didn’t understand your previous explanation. If you have installed phplist in the default location, i.e. accessed as mysite.com/lists then you don’t need to set $pageroot because the default value is correct.
If you have installed phplist in a different location then you do need to set $pageroot.

@duncanc even if it is installed in the correct directory the error persists, if I change the $pageroot to the correct directory I get the same error. I don’t really understand why this happens. To be honest I don’t really understand why this variable has to be set at all and I cannot seem to find any remedy for this problem. The error is the same if the pageroot variable is set or not.

@sortebill The variable is used by phplist to construct full URLs to phplist for use by user and click tracking, amongst others. Have you installed phplist on a subdomain, in which case $pageroot should be an empty string.

@duncanc I can’t seem to find any solution for this problem so I’ll just have to look at some other software. Phplist seemed promising but if such a trivial thing is going to make the entire thing not work then it’s probably best to spend time on something that will work on a basic shared host without problems. Thanks for your reply.

@sortebill Did you try setting $pageroot to an empty string? What is the URL to your phplist installation?

You can disable the warning by setting another value in config.php

define('WARN_ABOUT_PHP_SETTINGS', 0);

@duncanc I tried that but got a similar error. I don’t remember what, I’ve tried reinstalling it and fudging around with this config file several times now.

https://kcontrol.no/lists/

It just seems very archaic to not have a better installer for something like this, I mean, most users who get these kinds of errors probably just give up and move on, so it would be good for phplist devs to sort it out so that this silly error doesn’t happen.

@sortebill Thanks, given that URL then the value of “/lists” for $pageroot should work. If it doesn’t then there’s something odd happening. Maybe there is an apache rewrite rule being used, or a soft link, which is confusing things.

@duncanc Aha, I’m not sure what kind of configuration my host actually uses but I haven’t had any issues with other php based things I’ve installed earlier.

@sortebill I know that it is not great, but you can ignore the warning. Given the URL of your phplist, it is important that $pageroot is set to "/lists" so that URLs are created correctly.

@duncanc I tried your suggestions and it seems to be working. But this really is a strange error, I wish there was some more information somewhere so we could get to the bottom of it for future users.

@sortebill If you have a few minutes to try to debug this problem. I am guessing that the method used by phplist to get the URL is not working on your server.
Can you add these lines to the end of config.php

var_dump(getenv('REQUEST_URI'));
var_dump($_SERVER['REQUEST_URI']);

Then access the phplist admin page. You will probably have to view the html source of the page to see what has been dumped. You can then remove the lines from config.php. Please copy the output here.

@duncanc I will try to do that, and see what it returns. Thanks for your help so far.

hi all,
… for all those who have the same problem:
It is apparently (???) important, that entries in the “config.php” file are entered at the end (!!!) of the file.
It’s best to just paste&copy the relevant lines from the file “config_extended.php” … do not add anything else.