SimpleMachines / SMF

Simple Machines Forum — SMF in short — is free and open-source community forum software, delivering professional grade features in a package that allows you to set up your own online community within minutes!
https://www.simplemachines.org/
Other
586 stars 253 forks source link

Undefined index: host #2013

Closed XinYenFon closed 10 years ago

XinYenFon commented 10 years ago

\Themes\Sources\Subs-Auth.php on line 134 \Themes\Sources\Session.php on line 41

Happens after installer creating admin account

Oldiesmann commented 10 years ago

Why wouldn't parse_url() return a "host" item in there as well? Unless the URL is a relative one (parse_url doesn't work with relative URLs), there should always be a host in the results...

illori commented 10 years ago

maybe an issue when using localhost vs a real server/host?

ChainyEO commented 10 years ago

I've just come across this problem, too (local install):

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Subs-Auth.php on line 134

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Subs-Auth.php on line 134

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Session.php on line 41

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Session.php on line 41

Don't know why those notices get repeated, but that's how it showed up... Below those notices, it still tells me that the forum installation was successful (but apparently it wasn't, as the forum main page won't open up).

During the installation I used MySQL (not the light one, which was default) and I also selected SSL. Everything else was with the default options.

EDIT: just tried it again, sticking with all the default options during installation. Same problem at the end.

live627 commented 10 years ago

What's your $scripturl and PHP version?

On Tue, Jul 22, 2014 at 6:47 PM, Chainy notifications@github.com wrote:

I've just come across this problem, too (local install):

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Subs-Auth.php on line 134

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Subs-Auth.php on line 134

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Session.php on line 41

Notice: Undefined index: host in /opt/lampp/htdocs/SMFalpha/Sources/Session.php on line 41

Don't know why those notices get repeated, but that's how it showed up... Below those notices, it still tells me that the forum installation was successful.

— Reply to this email directly or view it on GitHub https://github.com/SimpleMachines/SMF2.1/issues/2013#issuecomment-49824042 .

ChainyEO commented 10 years ago

@live627

By $scripturl, I suppose you mean this: http://localhost/SMFalpha/

PHP version = 5.5.11 (I'm using XAMPP for Linux from Apache Friends)

SMF2.0.8 installed with no problems. Just have this problem with 2.1.

Oldiesmann commented 10 years ago

What does this return?

<?php
echo '<pre>' . print_r(parse_url('http://localhost/SMFalpha/')) . '</pre>';
?>
illori commented 10 years ago
Array ( [scheme] => http [host] => localhost [port] => 8080 [path] => /github2.1/ )

1
illori commented 10 years ago

given my server is on port 8080

Oldiesmann commented 10 years ago

That's what I expected. It must be returning something different for the others then.

illori commented 10 years ago

actually i cant duplicate the issue on my localhost... wamp with php 5.5.12

i know i saw the issue when i did the install for Irisado on wamp with php 5.4.

illori commented 10 years ago

actually i went further in the install and i can duplicate the issue, it is on the page after you enter the admin details.

ChainyEO commented 10 years ago

Yes, the problem comes up right at the end, where you have the option to click on the link to take you to your new forum. The page where it tells you that the installation was successful!

@Oldiesmann

This is what I got:

Array ( [scheme] => http [host] => localhost [path] => /SMFalpha/ )

1
ChainyEO commented 10 years ago

Just wondering if there's a temporary workaround for this bug? Just so that I can get SMF2.1 up and running on my local server...

Oldiesmann commented 10 years ago

This is only related to the redirection to your forum after everything is done installing, right?

I still have no idea why there wouldn't be a "host" in the array returned though.

ChainyEO commented 10 years ago

@Oldiesmann

Yes, you're right. It's a redirection issue. When I type in the full URL, the forum opens up fine.

The failed redirection really gives the impression of a failed installation, though! Certainly very confusing if you're not familiar with such error messages...

Thanks for pointing this out - I can now tinker around with 2.1 to try things out.

Oldiesmann commented 10 years ago

This is all spawned from the call to setLoginCookie (the code to automatically log you in after the install is complete), but I still have no idea why parse_url wouldn't have a host in it unless $boardurl is somehow being set improperly.

illori commented 10 years ago

IMO this should be fixed before a beta 1 release... we do want users to be able to install SMF without errors.

margarett commented 10 years ago

This is actually an easy fix. Just global $boardurl in function DeleteInstall() ;)

margarett commented 10 years ago

With this fix I don't get the undefined error BUT I'm also not automatically logged in after install...