Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

error page import after installation

edited November 2005 in Vanilla 1.0 Help
Have run the installer.php as well as uploaded and set up files manually but don't get beyond this one: as soon as I log in, I get hit with this error: A fatal, non-recoverable error has occurred Technical information (for support personel): Error Message: Failed to import file "controls/forum". Affected Elements: Page.Import(); For additional support documentation, visit the Lussumo Documentation website at: lussumo.com/support - Tables in the database are created - file permissions are set - checked the forum - read the trouble shooting advice - PHP Version 4.3.10 - MySQL 4.0.18 Not sure what else to do - any idea? Thanks Christoph

Comments

  • Options
    Hmm. This is certainly one i've not seen before. Judging by a quick glance at the file, the way page.import works is thus: function Import($FileName) { if (!@include($FileName)) $this->Context->ErrorManager->AddError($this->Context, "Page", "Import", "Failed to import file \"".$FileName."\"."); } So it's simply include()ing whatever filename is being requested - in this case controls/forum. As far as i know, that file doesnt exist. So now i'm really stumped for why it's even trying. Hmm...
  • Options
    mind if i ask what domain your install is running on?
  • Options
    MarkMark Vanilla Staff
    edited October 2005
    Yes, as always, can you pass along the url to your installation? If you are concerned about privacy, you can whisper it to one of us.
  • Options
    edited October 2005
    Hi, no, not concerned about privacy yet - there is no data to worry about :) Anyways, it may also help someone else once its resolved:

    http://ccgi.absolutz.plus.com/haliki
  • Options
    hmm. Interesting. Are there any accounts setup yet? The installer should have created one if you havent wiped the database since. If there is one a username/password could be useful. I'm considering it could be a path setup a little wonky somewhere along the line.
  • Options
    MarkMark Vanilla Staff
    edited October 2005
    Try signing in and then typing the actual url to the index.php file: http://ccgi.absolutz.plus.com/haliki/index.php It could be a wierd apache/php thing where php isn't acknowledging the index.php file because of apache settings...
  • Options
    yeah, i noticed index.php worked but without a signing i stuck myself. There does seem to be a bit of an unusual apache setup going on over there.
  • Options
    Ok, after signing in and using the actual URL http://ccgi.absolutz.plus.com/haliki/index.php it does work, I checked that index.php has got execute permissions in that folder but still no luck with using the full URL. What could be the problem?
  • Options
    ok, I have raised a ticket with support but they said its a script thing not a set up thing - they placed a phpinfo file in there as index.php and it worked fine, so back to square one. How else can I debug this/find the problem?
  • Options
    MarkMark Vanilla Staff
    Can you whisper a username and password to one of us so we can take a closer look?
  • Options
    MarkMark Vanilla Staff
    Okay, here's how the control file importing works.

    Every file in the root of vanilla has a corresponding "control file" in the "controls" directory. The control file contains controls which are rendered on the page.

    When a page loads in Vanilla, it runs through some basic page setup stuff, and then it includes the control file that corresponds with that page's name.

    So, if you're looking at "some_file_name.php", it will need to include the "controls/some_file_name.php" file. I get the current file's name by using a server-configured php function, like this:

    $this->SelfUrl = basename(ForceString(@$_SERVER['PHP_SELF'], "index.php"));

    Basically, I'm telling the page to get it's own page name (aka "SelfUrl"). The $_SERVER['PHP_SELF'] value is a server configured value that tells you what the current url is.

    The ForceString function is given two values - the value given by the server as PHP_SELF and a "default" value. If the server defined value comes back empty, then the forcestring function will return the "default value", in this case "index.php".

    The basename function strips the file name off the url given by $_SERVER['PHP_SELF'] and returns it.

    So, it looks like this is what's happening:

    Your server is returning something like http://ccgi.absolutz.plus.com/haliki/ as PHP_SELF. This is already incorrect, since it should be returning something like http://ccgi.absolutz.plus.com/haliki/index.php regardless of whether the index.php is visible in the url or not. The ForceString function is then just spitting that value back out, and then basename is then stripping the haliki off the url and returning it. Then my code attempts to include a file named "controls/haliki", which is obviously incorrect - and we get our error.

    There is a quick fix I can give you to make it work, but I'm telling you that this is definitely a server configuration problem. Web server tech support people will ALWAYS blame problems on php scripts if they find out that your problem involves one in any way. It's just easier for them to say, "Not our fault" and move on to "helping" the next person.

    To fix it, I'd do something like this (unless someone else has a better idea):

    Open up library/Utility.Context.class.php.

    Add the following line below line 72, so 72 and 73 appear like so:

    $this->SelfUrl = basename(ForceString(@$_SERVER['PHP_SELF'], "index.php")); if ($this->SelfUrl == "haliki") $this->SelfUrl = "index.php";

    Keep in mind that I haven't tested this fix, so it might not work immediately and we may have to tweak it a bit - but if my assumptions are correct, it should work just fine.
  • Options
    hi, thanks so much for the reply and the extensive explanation. I will raise another ticket as I would like to leave the code untouched if at all possible. I will get back when I have any news...
  • Options
    hi, are you saying the php_self should *always* return the 'index.php' bit, regardless of whether it was typed in or just the folder? The only other place I can test this is a windows machine with php on it where it does bring back the full /haliki/index.php if I only type in /haliki/ in the browser. However, the support team now reckons that this is a difference beteween windows and unix? I
  • Options
    MarkMark Vanilla Staff
    *slaps forehead* Okay, here's some proof for you: http://lussumo.com/proof/
  • Options
    edited October 2005
    *me grabs the bats out the cupboards and hands one to mark (for your support team, christoph, not you :))
  • Options
    guys, thanks so much for your help - I suspected this is the case. I have sent the support team a reply with your url. I think they are even running debian, too... See what happens and thanks so much again!
  • Options
    Hi there - well, now, hmm, not sure what to say. The support team have acknowledged that the script is affected by the server config but as they have not had anyone else complaining, they won't change the server config. Instead, they advise a workaround on the script which works like this: Open up library/Utility.Context.class.php. Add the following below line 72, so 72 and 73 appear like so: $this->SelfUrl = basename(ForceString(@$_SERVER['PHP_SELF'], index.php")); if ($this->SelfUrl == "haliki") $this->SelfUrl = "index.php"; I have tried this and it does work. I am not sure if I like this as it means I am 'messing' with the core but it looks like this is currently the only option. I will let you know if anything else comes up... Thanks again for your help on this
  • Options
    MarkMark Vanilla Staff
    haha - that's the workaround I posted for you above - they probably read it off this page. It's not a big deal - just be sure to fix it again when the next revision comes out this month.
  • Options
    would you possibly know what the setting would be to show the correct php_self valu? Is this a setting in php.ini?
  • Options
    MarkMark Vanilla Staff
    I'm not sure exactly. I'd bet it is an apache configuration setting.
This discussion has been closed.