SMF icon indicating copy to clipboard operation
SMF copied to clipboard

Undefined index: host

Open XinYenFon opened this issue 12 years ago • 19 comments

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

Happens after installer creating admin account

XinYenFon avatar Jul 02 '14 00:07 XinYenFon

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

Oldiesmann avatar Jul 02 '14 15:07 Oldiesmann

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

illori avatar Jul 02 '14 15:07 illori

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.

ChainyEO avatar Jul 23 '14 01:07 ChainyEO

What's your $scripturl and PHP version?

On Tue, Jul 22, 2014 at 6:47 PM, Chainy [email protected] 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 .

live627 avatar Jul 23 '14 03:07 live627

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

ChainyEO avatar Jul 23 '14 05:07 ChainyEO

What does this return?

<?php
echo '<pre>' . print_r(parse_url('http://localhost/SMFalpha/')) . '</pre>';
?>

Oldiesmann avatar Jul 23 '14 16:07 Oldiesmann

Array ( [scheme] => http [host] => localhost [port] => 8080 [path] => /github2.1/ )

1

illori avatar Jul 23 '14 16:07 illori

given my server is on port 8080

illori avatar Jul 23 '14 16:07 illori

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

Oldiesmann avatar Jul 23 '14 16:07 Oldiesmann

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 avatar Jul 23 '14 16:07 illori

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

illori avatar Jul 23 '14 16:07 illori

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 avatar Jul 23 '14 17:07 ChainyEO

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

ChainyEO avatar Aug 04 '14 20:08 ChainyEO

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.

Oldiesmann avatar Aug 07 '14 16:08 Oldiesmann

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

ChainyEO avatar Aug 07 '14 19:08 ChainyEO

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.

Oldiesmann avatar Aug 08 '14 14:08 Oldiesmann

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

illori avatar Aug 18 '14 09:08 illori

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

margarett avatar Aug 20 '14 11:08 margarett

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

margarett avatar Aug 20 '14 12:08 margarett