Advertisement:

Author Topic: Your installer for the latest version of smf_2-0-15 has a flaw, It doesn't use..  (Read 2747 times)

Offline iconic420

  • Newbie
  • *
  • Posts: 1
It doesn't use the full domain. Instead it inserts 127.0.0.1 or localhost , it make a issues with the database population stage in the installer.


-David
« Last Edit: July 30, 2018, 05:02:25 PM by Gwenwyfar »

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,246
  • 'Tis the gift to be simple (duh)
The installer displays localhost as default setting.  If host uses actual server address, you have to put it in that field or SMF will not be able to connect to database.  If connection is successful, db should populate correctly.

Online Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 17,386
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
That is a known issue AFAIK, and not actually a bug in the installer, but an incompatibility with certain server setups. In these cases the installer fails to recognize the urls correctly, and they should be fixed manually.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.

How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,834
That is a known issue AFAIK, and not actually a bug in the installer, but an incompatibility with certain server setups. In these cases the installer fails to recognize the urls correctly, and they should be fixed manually.

actually it is a bug that was attempted to be fixed years ago but never actually fixed the issue. i think they corrected it in SMF 2.1, but it has not been back ported as we cant always duplicate the issue to confirm the fix.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 57,093
  • Gender: Male
    • Kindred-999 on GitHub
however, there is a simple work-around/fix --- use repair_settings.php to correctly reset the domain and url settings
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Gwenwyfar

  • Pirate Valkyrie Neko-chan
  • On Hiatus
  • SMF Hero
  • *
  • Posts: 1,519
  • Gender: Female
    • Gwenwyfar on GitHub
    • My pixiv
Is this the same as this bug or something else?
What is a friend to you?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,285
    • StoryBB/StoryBB on GitHub
Same symptoms for sure.

I don’t have access to a real PC right now but does the 2.0 installer actually have the opcache code in it? If not that would explain it...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Gwenwyfar

  • Pirate Valkyrie Neko-chan
  • On Hiatus
  • SMF Hero
  • *
  • Posts: 1,519
  • Gender: Female
    • Gwenwyfar on GitHub
    • My pixiv
Nope. The issue with opcache was already confirmed, I'm only wondering whether this is the same thing.
What is a friend to you?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,285
    • StoryBB/StoryBB on GitHub
In other words, it's not fixed even though I provided a fix for it 5 years ago, because the fixed version isn't actually in the installer package.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 57,093
  • Gender: Male
    • Kindred-999 on GitHub
yes, it's the same thing, Gwen.

I suspect that the fix went in for at least one release, Arantor... and then, for some reason may have been reverted due to some confusion with the systems....
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,285
    • StoryBB/StoryBB on GitHub
Correct! It's in the 2.0.7 installer package but not in 2.0.8 or beyond.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,834
this change is in install.php right? i dont see the change having been applied to SVN... which is very strange.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,285
    • StoryBB/StoryBB on GitHub
Yup, it's a change to install.php - and it's definitely there in the 2.0.7 install package, so look for a change somewhere around winter 2013. Not sure why it isn't in SVN, maybe I did something stupid like asking people to try it out and let me know if it solved the problem before putting it in SVN.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 57,093
  • Gender: Male
    • Kindred-999 on GitHub
well, the issue with that would have been that none of us have been able to successfully recreate the issue... lots of reports of it, but it has always worked properly for me.


Anyway... don't know why it didn't get committed, but at least we know the CAUSE now.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,834
can you post a diff Arantor, so we can get it commited for the next version?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,285
    • StoryBB/StoryBB on GitHub
I'm not sure what bizarre patch format WinMerge gave me but the patch from 2.0.6 to 2.0.7's install.php file is as follows:

Code: [Select]
11c11
<  * @version 2.0.6
---
>  * @version 2.0.7
14c14
< $GLOBALS['current_smf_version'] = '2.0.6';
---
> $GLOBALS['current_smf_version'] = '2.0.7';
1964a1965,1969
>
> // Even though on normal installations the filemtime should prevent this being used by the installer incorrectly
> // it seems that there are times it might not. So let's MAKE it dump the cache.
> if (function_exists('opcache_invalidate'))
> opcache_invalidate(dirname(__FILE__) . '/Settings.php', true);

In other words, it looks like the following find/replace.

Code: (find) [Select]
// Gotta have one of these ;)
if (trim($settingsArray[0]) != '<?php')
fwrite($fp, "<?php\n");

$lines = count($settingsArray);
for ($i = 0; $i < $lines - 1; $i++)
{
// Don'
t just write a bunch of blank lines.
if ($settingsArray[$i] != '' || @$settingsArray[$i 1] != '')
fwrite($fpstrtr($settingsArray[$i], "\r"''));
}
fwrite($fp$settingsArray[$i] . '?' '>');
fclose($fp);

return true;

Code: (replace) [Select]
// Gotta have one of these ;)
if (trim($settingsArray[0]) != '<?php')
fwrite($fp, "<?php\n");

$lines = count($settingsArray);
for ($i = 0; $i < $lines - 1; $i++)
{
// Don'
t just write a bunch of blank lines.
if ($settingsArray[$i] != '' || @$settingsArray[$i 1] != '')
fwrite($fpstrtr($settingsArray[$i], "\r"''));
}
fwrite($fp$settingsArray[$i] . '?' '>');
fclose($fp);

// Even though on normal installations the filemtime should prevent this being used by the installer incorrectly
// it seems that there are times it might not. So let's MAKE it dump the cache.
if (function_exists('opcache_invalidate'))
opcache_invalidate(dirname(__FILE__) . '/Settings.php'true);

return true;
}

Slightly different fix to the one proposed in the other topic but the substance is the same - before trying to reuse Settings.php, make sure the opcache doesn't get involved. I just flush the cache after writing the file, the other fix flushes the cache in all situations (not just only after a change is made)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 49,834
i have flagged this for the devs.

Offline Gwenwyfar

  • Pirate Valkyrie Neko-chan
  • On Hiatus
  • SMF Hero
  • *
  • Posts: 1,519
  • Gender: Female
    • Gwenwyfar on GitHub
    • My pixiv
yes, it's the same thing, Gwen..
Okay, then this makes at least 3 duplicate topics on this :P

well, the issue with that would have been that none of us have been able to successfully recreate the issue... lots of reports of it, but it has always worked properly for me.


Anyway... don't know why it didn't get committed, but at least we know the CAUSE now.
If nothing was changed in the last few months, I can replicate it in my host. If I recall, it was only some php versions also. Essentially needs to have opcache + be a specific version I believe. We have many people testing in latest php versions, so it figures those bugs are missed.

I'll give it some testing once a patch has been made.
What is a friend to you?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,285
    • StoryBB/StoryBB on GitHub
The patch is two posts up...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Gwenwyfar

  • Pirate Valkyrie Neko-chan
  • On Hiatus
  • SMF Hero
  • *
  • Posts: 1,519
  • Gender: Female
    • Gwenwyfar on GitHub
    • My pixiv
I saw, and that was not what I meant with patch. I could also copy the fix on github for 2.1, and yes it works :P

I guess I can give this fix the "green light approval testing badge" too, when I have the time.
What is a friend to you?