Forums | Mahara Community
Support
/
Installation problem using XAMPP
16 June 2009, 10:25
Hi all,
I am trying to run mahara 1.1.4 on my desktop machine using Xampp with MySQL 5.0.51a and PHP 5.2.5
When I go to localhost/mahara I'm redirected to localhost/\mahara/admin, which doesn't exist because of the forward slash - backslash after 'localhost'. If I take out the backslash I arrive on the admin/upgrade.php page.
The installation gets stuck there.
Any ideas why I'm getting '/\' in my urls, and how I can complete the installation?
Thanks,
Mike
16 June 2009, 17:45
Hi - first, a note that Mahara isn't officially supported on windows, so don't be surprised if you find bugs like this . Still, we will try to fix them if we find them.
I guess that the auto-detection of wwwroot has not worked correctly. If you're interested, the code is in init.php. It looks for whether the host name has a '/' on the end, and if it doesn't, it adds it. I guess it should be looking for DIRECTORY_SEPARATOR instead.
If all the above was gobbledegook, feel free to file a bug on the tracker and link to this thread - one of the devs can look at it later
Thanks for the report!
17 June 2009, 3:56
Hi Nigel,
You identified the main problem. The path is taken as a substring of $_SERVER['DOCUMENT_ROOT'] so on Windows it's something like \mahara.
We need the backslash to be a forward slash for it to work as part of a URL. Using DIRECTORY_SEPARATOR didn't achieve that so i just added in a little check in init.php for windows as follows -
if ($path) {
// hack to work with windows
if (substr($path, 0, 1) == '\\') {
$path = '/' . substr($path, 1);
}
// everything else unchanged
That fixed it and it installed OK after that. Thanks for the help! I'll submit a bug to the tracker.
Mike
28 August 2009, 10:42
where do I exactly have to place this piece of code?
Regards.
Lino Oliveira
30 August 2009, 20:10
In init.php, somewhere around line 167 I think. It doesn't look like we applied anything to Mahara to fix this, as we can't test it, so it would still be necessary to apply this patch.16 October 2009, 5:56
Hi
I have just installed version 1.1.6 (2009022617) on XAMPP and had the same problem.
The code in init.php is present but did not work in this case.
Putting the following in to mahara/config.php solved the problem
$cfg->wwwroot = 'http://localhost/mahara/';
13 November 2009, 15:59
Hi,
Can everyone give me some direction as to how to install on a localhost XAMPP Windows and MySQL with Moodle 2.0. I have no idea where to begin. I will keep this patch in mind tho.