Forums | Mahara Community

Support /
Installation problem using XAMPP


anonymous profile picture
Deleted user
Posts: 131

16 June 2009, 10:25 AM

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

anonymous profile picture
Deleted user
Posts: 1643

16 June 2009, 5:45 PM

Hi - first, a note that Mahara isn't officially supported on windows, so don't be surprised if you find bugs like this Wink. 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 Smile

Thanks for the report!

anonymous profile picture
Deleted user
Posts: 131

17 June 2009, 3:56 AM

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

 

anonymous profile picture
Deleted user
Posts: 1643

17 June 2009, 7:44 PM

Great, thanks for doing that! Cool
Lino Oliveira's profile picture
Posts: 54

28 August 2009, 10:42 AM

where do I exactly have to place this piece of code?

Regards.

Lino Oliveira

anonymous profile picture
Deleted user
Posts: 1643

30 August 2009, 8:10 PM

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.
anonymous profile picture
Deleted user
Posts: 1

16 October 2009, 5:56 AM

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/';

anonymous profile picture
Deleted user
Posts: 5

13 November 2009, 3:59 PM

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.

8 results