Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Installing SilverStripe

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Windows install fails due to .htaccess RewriteBase \


Reply

2 Posts   3131 Views

Avatar
fijiaaron

25 January 2009 at 4:20pm Community Member, 3 Posts

I've seen a lot of people with Windows installation problems. Just downloaded Silverstripe myself and ran into one, with a proposed fix. Is there an IRC channel or somewhere to talk with developers?

Anyway, I'm installing with an existing Apache 2.2 on WindowXP, not WAMP. I'm using an Apache VirtualHost directive so the URL is:

http://silverstripe.mysite.localhost instead of http://mysite.localhost/silverstripe

It crashes Apache after writing the .htaccess file. On restart and reload of install.php I get an error message like:

[alert] [client 127.0.0.1] C:/mysite/silverstripe/.htaccess: RewriteBase takes one argument, the base URL of the per-directory context, referer: http://silverstripe.mysite.localhost/install.php

The .htaccess file has the following line:

RewriteBase \

which I believe needs changed to:

RewriteBase /

In the install.php file I see the following:

function createHtaccess() {
$start = "### SILVERSTRIPE START ###\n";
$end = "\n### SILVERSTRIPE END ###";
$base = dirname($_SERVER['SCRIPT_NAME']);
if($base != '.') $baseClause = "RewriteBase $base\n";
else $baseClause = "";

I think the problem is that Windows is returning a backslash for dirname(), where it needs a forwardslash. (see http://us.php.net/manual/en/function.dirname.php)

I propose the following possible fix:

$base = dirname($_SERVER['SCRIPT_NAME']);
+++ if($base == '\') $base = '/';
if($base != '.') $baseClause = "RewriteBase $base\n";
else $baseClause = "";

Avatar
fijiaaron

25 January 2009 at 4:44pm Community Member, 3 Posts

Hmm... that doesn't seem to take care of the problem