Your installer for the latest version of smf_2-0-15 has a flaw, It doesn't use..

Started by iconic420, May 03, 2018, 05:39:20 PM

Previous topic - Next topic

iconic420

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

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Aleksi "Lex" Kilpinen

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.
Slava
Ukraini!


"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

How you can help SMF

Illori

Quote from: Aleksi "Lex" Kilpinen on May 04, 2018, 01:46:49 AM
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.

Kindred

however, there is a simple work-around/fix --- use repair_settings.php to correctly reset the domain and url settings
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Gwenwyfar

"It is impossible to communicate with one that does not wish to communicate"

Arantor

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...

Gwenwyfar

Nope. The issue with opcache was already confirmed, I'm only wondering whether this is the same thing.
"It is impossible to communicate with one that does not wish to communicate"

Arantor

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.

Kindred

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....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Correct! It's in the 2.0.7 installer package but not in 2.0.8 or beyond.

Illori

this change is in install.php right? i dont see the change having been applied to SVN... which is very strange.

Arantor

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.

Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Illori

can you post a diff Arantor, so we can get it commited for the next version?

Arantor

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:

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)

Illori


Gwenwyfar

Quote from: Kindred on July 30, 2018, 03:00:32 PM
yes, it's the same thing, Gwen..
Okay, then this makes at least 3 duplicate topics on this :P

Quote from: Kindred on July 30, 2018, 04:06:05 PM
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.
"It is impossible to communicate with one that does not wish to communicate"

Arantor


Gwenwyfar

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.
"It is impossible to communicate with one that does not wish to communicate"

Advertisement: