Undefined index: HTTP host

160 views
Skip to first unread message

Emad Ahmad

unread,
Feb 15, 2015, 9:27:47 AM2/15/15
to resour...@googlegroups.com
Dears
I need help setting staticsync
when I execute the staticsync.php, I get Undefined index
Any idea how to make it work?!!
thanks

Robert Damrau

unread,
Feb 17, 2015, 10:04:38 AM2/17/15
to resour...@googlegroups.com
Are you using the bitnami stack? If so, you need to hardcode $baseurl in your config.php. Via cli php cannot access $_SERVER variables therefore will produce an error. So for example with bitnami part your config.php looks like this:

# Base URL of the installation
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
    $baseurl   = 'https://' . $_SERVER['HTTP_HOST'] . '/resourcespace';
} else {
    $baseurl   = 'http://' . $_SERVER['HTTP_HOST'] . '/resourcespace';
}

change $baseurl to yor server url, for example:


or you can merge both and just hardcode it for cli case:

# Base URL of the installation
if (isset($_SERVER['HTTP_HOST'])) {
    if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
        $baseurl   = 'https://' . $_SERVER['HTTP_HOST'] . '/resourcespace';
    } else {
        $baseurl   = 'http://' . $_SERVER['HTTP_HOST'] . '/resourcespace';
    }
} else {
    $baseurl = 'http://localhost/resourcespace';
}
Reply all
Reply to author
Forward
0 new messages