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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

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

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

Windows install fails due to .htaccess RewriteBase \


Go to End


2 Posts   4788 Views

Avatar
fijiaaron

Community Member, 3 Posts

25 January 2009 at 4:20pm

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

Community Member, 3 Posts

25 January 2009 at 4:44pm

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