Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

Categories

In this Discussion

Who's Online 12

CurtisOdenericgillettejohansonlockerleafmonster422 +7 guests

Vanilla fails to install on PHP5.2.17, Windows7, Apache2.2

Hello, seems to me that Vanilla setup fails to save configuration to config.php at class.configuration.php, line 536:
chmod($TmpFile, 0775);
$Result = rename($TmpFile, $File); // Returns false.

After I modified code as follows, setup completed successfully:
chmod($TmpFile, 0775);
if(is_file($File)) {
unlink($File);
}
$Result = rename($TmpFile, $File);

Comments

  • hbfhbf
    Posts: 654
    Thanks!!! this solved my problem of perpetual return to the setup screen.
  • Posts: 2,058

    Vanilla developer [GitHub, Twitter]

  • Posts: 1,586 Accepted Answer 1 like
    @schket, I'm worried about your method because it is not atomic and susceptible to a race condition. Can you try the following:
    chmod($TmpFile, 0775);
    if (!rename($TmpFile, $File)) {
    if (copy($TmpFile, $File)) {
    unlink($TmpFile);
    $Result = TRUE;
    }
    }
    I'm proposing you try a copy and unlink the temp file rather than unlink the original file.

    Vanilla co-founder

  • @Todd, I actually did not try this code in Vanilla, but I checked how rename() and copy() behave in test .php and it works right as expected, so your proposed code should work.
  • can someone put up the complete file so I can also use it? Better than going into the page... better to reload a completed page and rerun from there. I am having some issues of my own.
  • Posts: 4 1 like
    @Todd, yep, your code is working, I have just tested it.
  • Posts: 1,586

    This code will be available in 2.0.18.2. The commit is available here.

    Vanilla co-founder

Sign In or Register to comment.