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, Ed, biapar, Willr, Ingo, swaiba

Persistent issues possibly with httpd.conf and/or .htaccess

Go to End

3 Posts   3660 Views


Community Member, 6 Posts

15 January 2009 at 5:12pm

Hi all,
I've been trying to install SS for a while now. Tried v2.2.3, v.2.3.0-rc2, and just recently 2.0.DailyBuild.2009-01-15.
I'm installing on my own freebsd server. All the checks on the first installation page are OK (php, mysql, apache, mod_rewrite, etc).

Here's the error I get for the DailyBuild:
Warning: file_get_contents( [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /web/shirley/htdocs/rewritetest.php on line 48
Warning: file_get_contents( [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /web/shirley/htdocs/rewritetest.php on line 48
mod_rewrite doesn't appear to be working. Make sure:

* mod_rewrite is enabled in your httpd.conf
* AllowOverride is enabled for the current path.

Please check these options, then refresh this page.If you believe that your configuration is correct, click here to proceed anyway.

Of course the obvious question is have I checked that mod_rewrite is enabled and AllowOverride All is there for my current path? And they are! When I tried to install v2.3.0-rc2, I seemed to get a little farther, however it failed with a message saying that friendly URLs were not working. I couldn't find useful help on this.

I have a pretty general question that maybe one of the developers of install.php (or rewritetest.php) can help with. There are a bunch of places where mod_rewrite is tested and they all revolve around defining a $location (some URL which doesn't exist, as far as I can see) and then they check for the contents of that file using file_get_contents. This is usually the test that fails and leads to the halt in my attempted install.

The strange this is that I can't find any code anywhere that would write the file defined in $location. Surely something must write it first before its contents can be checked.

I'm no expert in php,javascript,ajax etc. Any advice here would be an education for me and might help me to weed out this problem for myself.

Let me repeat what most seem to say: SilverStripe looks great and I'd really love to get it working.



Community Member, 6 Posts

16 January 2009 at 5:20am

So I think I understand what might be happening. I'm teaching myself, so bear with me here:
The $location set to InstallerTest/testrewrite is actually a call to a sapphire function in sapphire/dev/InstallerTest.php which should echo the string 'OK'. This doesn't seem to work, and I think this might be related to the report above that friendly URLs are not working, i.e., setting the $location to should (if it doesn't exist as a file or directory) be translated as something like (maybe).
I'll try explicitly entering this in my browser and see what I can do.
If you think you can help me with this, please chime in.


Community Member, 6 Posts

16 January 2009 at 7:16am

OK, I think we've got to the bottom of this one.
Having consulted with my webadmin, it looks like I was screwing up something with Apache.
I was editing httpd.conf, but my site is actually a virtual host and I should have left httpd.conf alone and concentrated on changing extras/httpd-vhosts.conf. I can post relevant details of that here:

# Virtual Hosts
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
# Please see the documentation at
# <URL:>;
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# configuration.

# Use name-based virtual hosting.
NameVirtualHost *:80

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
<VirtualHost *:80>
ServerAdmin someone@somewhere.som
ServerAlias site

DocumentRoot "/path/to/webroot"
<Directory "/path/to/webroot">
Options Indexes FollowSymLinks SymLinksifOwnerMatch
AllowOverride All
Order allow,deny
Allow from all
ErrorLog "/var/log/httpd/site-error.log"
CustomLog "/var/log/httpd/site-access.log" combined

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php index.html index.htm

# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All


I tried to reinstall v2.3.0-rc2 from scratch and it worked like a dream. Now I can edit my site and begin doing some real work.
I hope this is useful to someone else using freebsd or otherwise.


P.S. Note that in firefox I was getting some weirdness: check-php.php What should firefox do with this file?
This just required flushing all the cache and it went away.